J2.5:Routing implementation details
From Joomla! Documentation
This article or section is incomplete, which means it may be lacking information. You are welcome to assist in its completion by editing it as well. If this article or section has not been edited in several days, please consider helping complete the content.
This article was last edited by Mvangeest (talk| contribs) 12 years ago. (Purge)
Application Route Parsing
The Application execution order outlines that the route (URL) is parsed immediately after initialisation is complete. Since fancy URL's are not treated (yet) in the Administrator, we will follow the route parsing process in detail when JSite::route
in the index.php file.
- Call to
JApplication::route
- Clone the URI
- Call to
JApplication::getRouter
- Call to
JRouter::getInstance
passing the type ("site")
- Call to
- Call to
JRouterSite::parse
passing the URI- Strip the suffix if applicable (added to $vars['format'])
- Re-set the route (URI)
- Call to
JRouter::parse
passing the URI- Call to
JRouterSite::_processParseRules
passing the URI (this will call custom route rules)- Call to
JRouter::_processParseRules
passing the URI- Call any custom routing rules (probably added via a system plugin using the
onAfterInitialise
event trigger) passing the URI - Returns an array of vars
- Call any custom routing rules (probably added via a system plugin using the
- If SEF mode, replace
start
variable with limitstart
- Call to
- If raw mode, call to
JRouterSite::_parseRawRoute
passing the URI - If SEF mode, call to
JRouterSite::_parseSefRoute
passing the URI- If the route (the URI path) is empty, load it from the default menu item; set the active menu item as the default
- If first part is
/component/com_content
, set theoption
as the second segement. Null theItemid
. - Else, loop through menu alias values and take off segments that match as the menu tree is traversed. Set
option
andItemid
based on the last menu item found. - If the
Itemid
is set in the URL, set the active menu item based on this value. - Push the vars collected so far (eg,
option
,Itemid
, etc) into the router object ($this
). - If the route and
option
is set, load the component router; - Else, get the active menu item and get the route vars from it
- Call to
Application Route Building
TODO
Custom Router Rules
TODO