Monday, January 21, 2013

Joomla Login redirect back to page to the previous page


If you want to redirect after login to the same page please use the code and enjoy ...

$return = JURI::getInstance()->toString();
$url    = 'index.php?option=com_user&view=login';
$url   .= '&return='.base64_encode($return);
$this->setRedirect($url, XiText::_('YOU_MUST_LOGIN_FIRST'));  // if you are in controller

or

JFactory::getApplication()->redirect($url, XiText::_('YOU_MUST_LOGIN_FIRST')); 

No comments:

Post a Comment