JRouter/parse: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Function to convert a route to an internal URI
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<now... |
No edit summary |
||
| Line 1: | Line 1: | ||
===Description=== | ===Description=== | ||
Function to convert a route to an internal URI | Function to convert a route to an internal URI | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
| Line 29: | Line 29: | ||
===Source Body=== | ===Source Body=== | ||
<source lang="php"> | <source lang="php"> | ||
function parse(&$uri) | |||
{ | { | ||
$vars = array(); | $vars = array(); | ||
| Line 37: | Line 37: | ||
// Parse RAW URL | // Parse RAW URL | ||
if ($this->_mode == JROUTER_MODE_RAW) { | if($this->_mode == JROUTER_MODE_RAW) { | ||
$vars += $this->_parseRawRoute($uri); | $vars += $this->_parseRawRoute($uri); | ||
} | } | ||
// Parse SEF URL | // Parse SEF URL | ||
if ($this->_mode == JROUTER_MODE_SEF) { | if($this->_mode == JROUTER_MODE_SEF) { | ||
$vars += $vars + $this->_parseSefRoute($uri); | $vars += $vars + $this->_parseSefRoute($uri); | ||
} | } | ||
Revision as of 22:11, 22 March 2010
Description
Function to convert a route to an internal URI
Template:Description:JRouter/parse
Syntax
parse(&$uri)
| Parameter Name | Default Value | Description |
|---|---|---|
Defined in
libraries/joomla/application/router.php
Importing
jimport( 'joomla.application.router' );
Source Body
function parse(&$uri)
{
$vars = array();
// Process the parsed variables based on custom defined rules
$vars = $this->_processParseRules($uri);
// Parse RAW URL
if($this->_mode == JROUTER_MODE_RAW) {
$vars += $this->_parseRawRoute($uri);
}
// Parse SEF URL
if($this->_mode == JROUTER_MODE_SEF) {
$vars += $vars + $this->_parseSefRoute($uri);
}
return array_merge($this->getVars(), $vars);
}
[Edit See Also] Template:SeeAlso:JRouter/parse
Examples
<CodeExamplesForm />