2012/8/18 Steve Rayner <[email protected]>
> 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