How can I redirect to another module?
return $this->redirect()->toRoute(null, array(
'module' => 'othermodule',
'controller' => 'somecontroller',
'action' => 'someaction'
));
This doesn't seem to work, any ideas?
How can I redirect to another module?
return $this->redirect()->toRoute(null, array(
'module' => 'othermodule',
'controller' => 'somecontroller',
'action' => 'someaction'
));
This doesn't seem to work, any ideas?
This is how I redirect from my Controller to another Route:
Where dns-search is the route I want to redirect to and companyid are the url params.
In the end the URL becomes /dns/search/1 (for example)
This is the way of redirection in ZF2:
I hope this helps you.
One of the easy ways to redirect is:
Google thinks, that this question is relevant to zf2 redirect with anchor, so I will add the answer here, if you don't mind. We can just use
fragment
option in third argument oftoRoute
:My route:
So, user will be directed to smth like
/chats/view/12/#m134