Support Joomla!

references:joomla.framework:application:japplication-redirect

Table of Contents

redirect

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplication Method redirect Reference redirect() Never Work in Progress

Redirects to another URL, optionally enqueueing a message in the system message queue (which will be displayed the next time a page is loaded) using the enqueueMessage method. If the headers have not been sent, the redirect will be accomplished using a ‘301 Moved Permanently’ code in the header pointing to a new location. If the headers have already been sent, this will be accomplished using a JavaScript statement. Redirect to another URL

Syntax

void redirect ( $url, $msg, $msgType )

$url string is a string containing the URL to which to redirect.
$msg string is a string containing a message to display on redirect (see enqueueMessage for more details).
$msgType string is a string containing the message type (see enqueueMessage for more details).

Examples

Example

global $mainframe;

$mainframe->enqueueMessage( 'The first message!' );
$mainframe->enqueueMessage( 'The second message!', 'alert' );
$mainframe->enqueueMessage( 'The third message!' );

$mainframe->redirect( JURI::base() . 'index.php?option=com_poll&redirected=1' );

might redirect the browser to http://127.0.0.1/administrator/index.php?option=com_poll&redirected=1.


 
references/joomla.framework/application/japplication-redirect.txt (1231 views) · Last modified: 2007/08/15 14:49