Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Default title, assets defined in layout or better in a event?[solved]

Hi, I created my base layout and defined there in the head my default assets.

/* @var $this \Phalcon\Mvc\View\Engine\Php */
$this->tag->setTitle("Default Title");

Is this the usual way or should I define the default assets and my default title in a view event like beforeRenderView? Somehow I have the feeling that it is better to define the base title/assets in an event because view's shouldn't have any logic.


Okay I think I got it. I moved the data to the ControllerBase class initialize function. I think this makes more sense. If someone has a better solution/way to do this please let me know.