Hi everybody,
I'm having trouble getting Hierarchical Rendering to work as expected. I have setup my view renderer and passed it to dependecy injector
// public/index.php
$di->set('view', function () {
$view = new \Phalcon\Mvc\View();
$view->setViewsDir('../app/views/');
$view->registerEngines(array('.phtml' => '\Phalcon\Mvc\View\Engine\Php'));
return $view;
});
I have also created app/views/index.phtml which is my main layout/template and have included the content in that file
<!-- app/views/index.phtml -->
<?php echo $this->getContent() ?>
I have also create controller template and corresponding view files for actions
<!-- app/layouts/user.phtml -->
<?php echo $this->getContent() ?>
<!-- app/user/signin.phtml -->
<h1>SIGN IN</h1>
When executing the signin action of my user controller, only the main layout (app/views/index.phtml) is rendered!
/**
* @RoutePrefix("/user")
*/
class UserController extends \Phalcon\Mvc\Controller
{
/**
* @Get("/signin")
*/
public function signinAction()
{
}
}
What have I missed? Any idea?