2010年7月12日星期一

[fw-mvc] Dispatch problem - between action method call and view rendering

Hi,

I need to accomplish this: once an Action method is called (for all actions, from any module and controller; not just for one case) so i can run my own code, but BEFORE the action view is actually rendered.

Sample of problem: I am trying to dynamically set the doctype for any action, based on the layout selected by each action. So the action view is also rendered with the same doctype as the layout!

If checking for the current layout occurs on a controller plugin postDispatch the view is already rendered so only the layout would have been rendered with correct doctype, and the action view is rendered with the default doctype rather than with the doctype of selected layout... So i need to actually set the doctype between action method call and action view rendering...

That's just a sample of problem. I couldn't accomplish this by using controller plugin postDispatch and also with a postDispatch of a registered helper (using Zend_Controller_Action_HelperBroker::addHelper);

Cristian

没有评论: