Hi I am trying to override the main layout in the multi module skeleton it is something like this common layouts main.volt frontend controller model view index.volt
Inside main.volt I do something like this: <!DOCTYPE html> <html> <head> <title>Common Layout</title> </head> <body> <div style="background: coral"> {% block content %}
{% endblock %}
</div>
</body>
</html>
and in my index.volt
{% extends "main.volt" %}
{% block content %} <h1>This is the frontend2!</h1>
<p>You're now flying with Phalcon.</p> {% endblock %}
my Module.php, has this code inside:
/**
* Setting up the view component
*/
$di['view'] = function() {
$view = new \Phalcon\Mvc\View();
$view->setViewsDir(__DIR__ . '/views/');
$view->setLayoutsDir('../../common/layouts/');
$view->setTemplateAfter('main');
$view->registerEngines([
".volt" => "Phalcon\Mvc\View\Engine\Volt"
]);
return $view;
};
But nothing is displaying on the main page, Have anyone got this working?