phalcon - before executing view event?

I want to execute:

$this->view->setVar("menus",$menus);

before the view gets executed.

$menus is an array that can be added in different controllers.

Finally before executing the view i want to put the menus var in the view.

function afterExecuteRoute() does not do the job



5.2k

I'd put it in the BaseController that's extended by all other controllers.



1.4k
edited Jun '14

Or u can use the view beforeRender event.