I want to execute some code right before the layout is rendered, after all other code is executed. Where would I put that code?
I am specifically trying to modify the files referenced in the headLink, headScript, and inlineScript view helpers before they're used by the layout.
Here are the steps I want to take:
It doesn't appear that a Front Controller Plugin is going to help me accomplish this, and here's why:
postDispatch()
gets executed after every controller action that's executed, and I need the full list of stylesheets/javascriptsdispatchLoopShutdown()
gets executed after the controller action loop, but the layout has already been rendered at this pointAs Rufinus suggested, I solved this by extending the View Helpers. My question from that angle as well as the solution is here.
see Orginal PDF created by Thorsten Ruf (Mirror)
the very last part you can access via plugin should be dispatchLoopShutdown
EDIT: For ZendFramework2 see http://zendframework2.de/en/cheat-sheet.html or this gdoc