After a succes form i want to redirect to another controller, i do that with toRoute. Below there is an example
return $this->redirect()->toRoute('plaatsenrubriek',array('controller'=>'AdvertentieController', 'action'=>'plaatsenrubriek'));
Is there a way to insert a variable in the toRoute to pass to the next controller?
The only way to pass a variable during a redirect would be to add a query parameter to the target route.
$bar = 'bar';
$this->redirect()->toRoute('myRoute', array(), array(
'query' => array(
'foo' => $bar,
)
));
Which would result in /myRoute?foo=bar