====== redirect ======
{#JAPI Joomla.Framework Application JController::redirect #}
Redirects the browser or returns false if no redirect is set.
The redirect is set using the [[jcontroller-setredirect|JController->setRedirect()]] method. It will invoke the [[japplication-redirect|JApplication->redirect()]] method.
This will end execution unless redirect is not set, in which case the method returns false.
===== Syntax =====
boolean redirect ()
===== Examples =====
The code that instantiates the controller, executes the task and redirects might look like:
$classname = 'WeblinksController'.$controller;
$controller = new $classname( );
// Perform the Request task
$controller->execute( JRequest::getVar('task'));
$controller->redirect();
with the code in the task handling method being:
$link = 'index.php?option=com_weblinks';
$this->setRedirect($link, $msg);
which would cause the browser to be redirected to the specified address. The message specified by $msg will be displayed on the target page (this is passed using the session).
----
~~DISCUSSION~~