Found it. In ZF2 it's now a controller plugin. ---------- Forwarded message ---------- From: Steve Rayner <srayne...@googlemail.com> Date: Sat, Aug 18, 2012 at 7:37 PM Subject: Re: [fw-general] ZF2 - pass parameter to view To: Jurian Sluiman <jur...@juriansluiman.nl>
Thanks for response. I guess that's one option. I probably didn't explain my use case very well. I think i'm looking for the flashMessenger, but i can't find it in the docs. Is it a view helper? On Sat, Aug 18, 2012 at 10:23 AM, Jurian Sluiman <jur...@juriansluiman.nl>wrote: > 2012/8/18 Steve Rayner <srayne...@googlemail.com> > >> If my controller action ends with this line; >> >> return $this->redirect()->toRoute('items'); >> >> can i pass an extra parameter to the view? ie, one extra variable. >> >> I want to pass the result status of the controller action, redirecting to >> user to another page but with an additional info pane. >> > > You could assemble an url from the route first, then attach a query > parameter (for example) and then redirect to that url. > > $url = $this->url()->fromRoute('items'); > $url .= '?status=ok'; > > return $this->redirect()->toUrl($url); > > Another option is you make the route "items" a segment route with an > (optional) status parameter. Then you could redirect to that route with the > given parameter: > > return $this->redirect()->toRoute('items', array('status' => 'ok')); > -- > Jurian Sluiman >