Reputation: 3267
I have magento site.
I have a controller ,how can i redirect into another function in this controller?
That means ,there have two functions:
1.test()
i want to redirect from test1() to test2()
how can i do this?
How can i redirect from one function to another function in the same controller?
Upvotes: 3
Views: 7809
Reputation: 5381
You can put something like this in test1 action.
$this->_redirect('*/*/test2', array(if you want to pass something then from here you can pass ));
Upvotes: 1
Reputation: 2004
There are three redirecting functions available in frontend controller which are:
_redirect()
_redirectUrl()
_redirectReferer()
_redirect('frontName/controllerName/actionName/param1/param2')
is used for internal redirection.
_redirectUrl($fullUrl)
is used for external redirection.
_redirectReferer()
is used to redirect to the referer url.
Hope this gives more info.
Upvotes: 8