I'm completely new to Phalcon and was wondering the same thing. Having used Twig, what is needed is the ability to specify multiple view
directories using a named key
which can then be referenced in Volt using a defined prefix like @
.
Obviously the example below will not work because Views
in Phalcon only accept a single path (as far as I can tell). But you get the idea?
$container->set('view', function()
{
$view = new View();
$view->setViewsDir('global', 'global/views/');
$view->setViewsDir('project', 'project/views/');
$view->registerEngines(
[
'.template' => 'voltService',
]
);
return $view;
}
);
{% extends "@project:layout.html.twig" %}
To find out more see the documentation under loaders: https://twig.sensiolabs.org/doc/2.x/api.html#twig-loader-filesystem