J2.5:Routing implementation details
From Joomla! Documentation
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::getInstancepassing the type ("site")
- Call to
- Call to
JRouterSite::parsepassing the URI- Strip the suffix if applicable (added to $vars['format'])
- Re-set the route (URI)
- Call to
JRouter::parsepassing the URI- Call to
JRouterSite::_processParseRulespassing the URI (this will call custom route rules)- Call to
JRouter::_processParseRulespassing the URI- Call any custom routing rules (probably added via a system plugin using the
onAfterInitialiseevent 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
startvariable with limitstart
- Call to
- If raw mode, call to
JRouterSite::_parseRawRoutepassing the URI - If SEF mode, call to
JRouterSite::_parseSefRoutepassing 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 theoptionas the second segement. Null theItemid. - Else, loop through menu alias values and take off segments that match as the menu tree is traversed. Set
optionandItemidbased on the last menu item found. - If the
Itemidis 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
optionis set, load the component router; - Else, get the active menu item and get the route vars from it
- Call to