We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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.