JRouter/getVar: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Get a router variable
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
... |
m clean up |
||
Line 2: | Line 2: | ||
Get a router variable | Get a router variable | ||
{{Description:JRouter/getVar}} | |||
{{subst:Description:JRouter/getVar}} | |||
===Syntax=== | ===Syntax=== | ||
Line 42: | Line 40: | ||
</source> | </source> | ||
{{subst:SeeAlso:JRouter/getVar}} | |||
{{SeeAlso:JRouter/getVar}} | |||
===Examples=== | ===Examples=== |
Revision as of 14:22, 24 March 2017
Description
Get a router variable
{{subst:Description:JRouter/getVar}}
Syntax
getVar($key)
Parameter Name | Default Value | Description |
---|---|---|
$key | The name of the variable |
Returns
mixed Value of the variable
Defined in
libraries/joomla/application/router.php
Importing
jimport( 'joomla.application.router' );
Source Body
public function getVar($key)
{
$result = null;
if (isset($this->_vars[$key])) {
$result = $this->_vars[$key];
}
return $result;
}
{{subst:SeeAlso:JRouter/getVar}}
Examples
<CodeExamplesForm />