Search This Blog

Thursday, May 26, 2011

Magento admin redirect from a form

Class used  Mage_Core_Controller_Varien_Action class.

 Redirect to url
_redirectUrl($url)

Check url to be used as internal
_isUrlInternal($url)

Redirect to error page
_redirectError($defaultUrl)


 Redirect to path
_redirect($path, $arguments=array())



 Redirect to success page
_redirectSuccess($defaultUrl)

Identify referer url via all accepted methods (HTTP_REFERER, regular or base64-encoded request param)
_getRefererUrl()

 Set referer url for redirect in response
_redirectReferer($defaultUrl=null)


You can use the redirect functions in your controller class.: $url = "http://abc.com";

$this->_redirectUrl($url);


Redirect with path and arguments:-

Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl($path, $arguments));




Mage::app()->getFrontController()->getResponse()->setRedirect($url);

2 comments:

  1. I dont know which fool says that this is his copy righted material...
    This is a 100% open source blog for magento lovers.
    -
    Author

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete