Work In Progress

This book is currently work in progress. Some sections are not yet written. Thank you for your understanding!

Router

Most components have a backend and a frontend part. The backend part is used by the site administrators to set up the content being managed by the component and the frontend part is used to display said content to the visitors of the site.

The case for URL routing

By default, Joomla's frontend URLs look something like this:

https://www.example.com/index.php?option=com_example&view=item&id=123&Itemid=456

This is called a regular or non-SEF URL. The SEF URL — what other CMS may call a “permalink” or a “route” — could be something like

https://www.example.com/acme-shop/roadrunner-hunting/explosives/tnt-crate.html

[Note]Note

SEF is an acronym which stands for Search Engine Friendly and is called like that for historical reasons — back in 2001 when Joomla's predecessor, Mambo, introduced this feature a human-understandable URL was also helping the primitive search engines of that era to get better context of what the page is about. This stopped being true by the time Joomla emerged as its own software, in 2005.

Joomla co-founder Brian Teeman coined a better, if not much more British, term: Pub Ear Friendly. The idea being that when you try to give the URL of a page to your mate while downing pints at your local, rather lively, pub it's easier to give them a few words they can understand than a long string of alphanumeric characters. For some reason this alternate term never stuck…

The transformation of the ugly, incomprehensible (at least to non-developers), non-SEF URL into the SEF URL and of the SEF URL back to the ugly non-SEF version (so Joomla can figure out which component to load and what to tell it to do) is called SEF routing in the Joomla vernacular. Most everywhere else you will see it being called URL routing. Well, the Joomla vernacular is full of certain historical quirks which makes it harder for newcomers to figure out what is what, but this is neither here nor there.

URL routing in Joomla is implemented in the core. However, the core code cannot possibly know how your component is supposed to logically structure its content so as to convert this into a human and machine understandable URL. Therefore it delegates that responsibility to the component, namely to our component's Router.