API15

JController/setRedirect: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Set a URL for browser redirection. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki...
 
Doxiki (talk | contribs)
No edit summary
Line 40: Line 40:
===Source Body===
===Source Body===
<source lang="php">
<source lang="php">
function setRedirect($url, $msg = null, $type = 'message')
function setRedirect( $url, $msg = null, $type = 'message' )
{
{
         $this->_redirect = $url;
         $this->_redirect = $url;

Revision as of 22:09, 22 March 2010

Description

Set a URL for browser redirection.

[Edit Descripton]

Template:Description:JController/setRedirect

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;
}

[Edit See Also] Template:SeeAlso:JController/setRedirect

Examples

<CodeExamplesForm />