That's not true. The plugin postDispatch always occurs after the rendering.
It doesn't matter if you manually render in the controller or let the
ViewRenderer render. The plugin postDispatch will still be called afterward.
You are also not altering the application flow by changing the action script
in the ViewRenderer. You're simply changing the value of an instance member.
And I believe that's exactly what you want. I'm not sure what led you to
believe that the flow is altered, but perhaps you could share with us some
code so we could see what's happening.

   -- Mon


On Mon, Jun 8, 2009 at 6:32 PM, agatone <zoran.z...@gmail.com> wrote:

>
> What i mean in all this is :
> If i don't change what script to render and leave it to find script to
> render byitself the flow is that every postDispatch() (controllers and
> plugins) is called before the render of view sscript.
>
> As soon as i try to render myown script postDispatch() is called after
> render of the view.
>
> In all this i am looking something that I can use just to tell what should
> be rendered and not to alter the flow - keep it same as if i wouldnt change
> the view script.
>
> All this solutions adding new stuff on it is way to much work for something
> simple :|
>
>
> Mon Zafra wrote:
> >
> > Indeed, the plugin postDispatch() is invoked after the helper
> postDispatch
> > (the ViewRenderer is a helper) where the rendering happens. If you need
> > stuff to happen after the action but before rendering, it must be in a
> > controller postDispatch or a helper postDispatch with a higher priority
> > than
> > ViewRenderer. Thankfully, the ViewRenderer has a very low priority so
> just
> > add the helper through the HelperBroker and you can be sure it would be
> > invoked before the ViewRenderer.
> >
> > Zend_Controller_Action_HelperBroker::addHelper(new My_Helper());
> >
> > class My_Helper extends Zend_Controller_Action_Helper_Abstract
> > {
> >     public function postDispatch()
> >     { /* pre-render logic here */ }
> > }
> >
> >    -- Mon
> >
> >
> > On Mon, Jun 8, 2009 at 4:42 PM, agatone <zoran.z...@gmail.com> wrote:
> >
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Controller-flow-changes-when-using-render%28%29-inside-controller-action-tp23915931p23921673.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to