How To Add A Redirect In Joomla 1.5 MVC Component

Posted: December 19, 2012 in Uncategorized

Today I want to show you how easy it is to set a redirect in your Joomla Component. Below is the easiest way to go about this.

$app = JFactory::getApplication();
$app->redirect($link, $msg);

You will want to make sure that there are variables set for $link and $msg. Also this is best used with an IF statement. Here is a full example on how to use the redirect.

   $link  = 'index.php';
   $msg   = 'You are not logged in.';  

   $app = JFactory::getApplication();
   $app->redirect($link, $msg);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s