I am using a \"multi module\" MVC structure for my PhalconPHP application.
One issue I am trying to figure out is how I can configure my \"Main Layout\" view to be <
At Phalcon ver 1.2.4(maybe in earlier versions too) one master "Main Layout" is possible. Phalcon builds lauout's path relatively a ViewsDir, that sets like
$view->setViewsDir('../apps/views/');
So, if set lauout's path relatively that, it's will work
$view->setLayoutsDir('./../../views/');
Maybe the best way to organise that structure to declare view object at application initialization and when in Module.php set ViewsDir:
// 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/');