I would like to have some input on the following:
- I would like some views to be systematically rendered (I can call $this->render from
my layout for these views) regardless of which controller/action is executed. - However the content used in these views is based on the same dynamically generated data and the code behind it is quite complex so I can’t put the logic inside the views for obvious optimization/performance issues.
- I could use $this->_helper->actionStack in each controller to call another controller in which data for the views would be prepared however I would like to do without modifying the existing controllers
I would be tempted to put something in the bootstrap since what I want is common to my application however I just don’t know what to do.
That’s what View Helpers are for.
In the View Helper you can fetch your data (through models or service layer) and prepare it for output.