How to redirect using the Joomla! 1.5 and 2.5 API

No Comments

When developing a Joomla! Component or Module you can use the Joomla! API to redirect the user from one page to another

Joomla! 1.5 Example

global $mainframe;
$link = 'http://yourlink';
$msg = 'message'
$mainframe->redirect($link, $msg, $msgType='message');

Joomla! 2.5 Example

$app = JFactory::getApplication();
$link = 'http://yourlink';
$msg = 'message'
$app->redirect($link, $msg, $msgType='message',$moved=false);

Take note that $msgType can be either messagenotice or error

The API page can be accessed here for Joomla! 1.5 and here for Joomla! 2.5

Image Credits: Photo by Isis França on Unsplash.

Last Updated On March 25, 2018

Related Articles

No results found

Leave a Reply

avatar
  Subscribe  
Notify of
Menu
Copy link