J2.5

J2.5:Routing implementation details

From Joomla! Documentation

Revision as of 00:53, 25 November 2012 by Mvangeest (talk | contribs) (Split off page from http://docs.joomla.org/index.php?title=Supporting_SEF_URLs_in_your_component&oldid=9893 (5 August 2008))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Content is Incomplete

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 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
          • If SEF mode, replace start variable with limitstart
        • 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 the option as the second segement. Null the Itemid.
          • Else, loop through menu alias values and take off segments that match as the menu tree is traversed. Set option and Itemid 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


Application Route Building

TODO

Custom Router Rules

TODO