JController/setRedirect: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m preparing for archive only |
||
| Line 57: | Line 57: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=setRedirect | category=setRedirect | ||
category=JController | category=JController | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 00:24, 25 March 2017
Description
Set a URL for browser redirection.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
setRedirect($url, $msg=null, $type= 'message')
| Parameter Name | Default Value | Description |
|---|---|---|
| $url | URL to redirect to. | |
| $msg | null | Message to display on redirect. Optional, defaults to value set internally by controller, if any. |
| $type | 'message' | Message type. Optional, defaults to 'message'. |
Returns
void
Defined in
libraries/joomla/application/component/controller.php
Importing
jimport( 'joomla.application.component.controller' );
Source Body
function setRedirect( $url, $msg = null, $type = 'message' )
{
$this->_redirect = $url;
if ($msg !== null) {
// controller may have set this directly
$this->_message = $msg;
}
$this->_messageType = $type;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples