Great! Thanks lightflowmark. You got my point and I got yours too. I think
the preDispatch method would work for me. I could change the predispatch
module/controller/action to the action that will change the layout before
the forwarded action is called. In this way, its not anymore necessary to
change the the code of the forwarded action just to do the layout change.

Thanks!


Fair enough :-)

In my own app, I change the layout on a per-controller basis, using a
front-controller plugin, hooking into dispatchLoopStartup().  (You could
also choose a layout on a per-module basis, a per-action basis, or any
combination of these).  If I've understood correctly, this is called exactly
once per request, regardless of any later _forward calls.  So, if you set
the layout at this stage, no matter what you do later, the original layout
should be used.  Probably ;-)  I don't have any _forwards between
controllers, so I haven't tested it as you describe.

It does mean that you have to maintain the layout logic outside the
module/controller/action that you want to control the layout for, but I find
that the layout logic changes rarely enough that it's not a problem.  YMMV.
-- 
View this message in context: 
http://www.nabble.com/communicating-with-forwarded-action-tp23173951p23197423.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to