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... |
m preparing for archive only |
||
| (3 intermediate revisions by 2 users not shown) | |||
| 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%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 17: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$uri | ||
| | | | ||
| | | | ||
| 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); | ||
} | } | ||
| Line 51: | Line 51: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=parse | category=parse | ||
category=JRouter | category=JRouter | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API15]] | |||
Latest revision as of 01:05, 25 March 2017
Description
Function to convert a route to an internal URI
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
parse(&$uri)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$uri |
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);
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples