We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to properly and correctly use volt architecture "Multi Module"

I try to do so but refuses to work templating

// Register the installed modules
$application->registerModules(
    array(
        'frontend' => function($di) use ($view) {
            $di->setShared('view', function() use ($view) {
                $view->setViewsDir('../apps/frontend/views/');
                $view->registerEngines(array(
                        ".volt" => 'Phalcon\Mvc\View\Engine\Volt'
                 ));
                return $view;
            });
        },
        'backend' => function($di) use ($view) {
            $di->setShared('view', function() use ($view) {
                $view->setViewsDir('../apps/frontend/views/');
                $view->registerEngines(array(
                     ".volt" => 'Phalcon\Mvc\View\Engine\Volt'
                ));
                return $view;
            });
        }
    )
);


98.9k
Accepted
answer


11.9k

well, my carelessness