We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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