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 Define a Default Layout for All controllers

In my project I would like to divide the initial page into 4 parts -HEADER -SIDEBAR -CONTENT -FOOTER

and this be the base template of the whole issue.

In the part of CONTENT I would just like to load the forms that are in the other views.



78.8k
Accepted
answer

$this->di->set('view', function () use ($config) {

            $view = new View();

            $view->setTemplateAfter('main')
                ->setLayoutsDir($config->layoutDir)
                ->setPartialsDir($config->particialDir);

...

you can check some examples here

https://github.com/phalcon/mvc

and i am not 100% sure but i think vokuro uses it as well https://github.com/phalcon/vokuro

this is for single module, if you need multi module, let me know