In Phalcon ver 1.2.4 (possibly in earlier versions), a single master layout wizard is possible. Phalcon builds a lauout path relative to ViewsDir, which sets how
$view->setViewsDir('../apps/views/');
So if you set the lauout path relative to this, it will work
$view->setLayoutsDir('./../../views/');
Maybe the best way to organize this structure is to declare a view object when initializing the application, and when ViewsDir is installed in Module.php:
// Application.php $di->set('view', function() use ($config) { $view = new View(); $view->setLayoutsDir('./../../views/'); $view->setLayout('index'); }, true);
and
// /module1/Module.php $di->get('view')->setViewsDir('../apps/module1/views/');
source share