O'Reilly logo

Mastering Joomla! 1.5 Extension and Framework Development by Chuck Lanham, James Kennard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Routing

To make Joomla! respond appropriately to a request, the application contains a JRouter object. This object determines the direction to take through the application. This is based on URI query values. To make Joomla! URIs friendlier, it can be set up to use SEF (Search-Engine Friendly) URIs.

In order to take advantage of SEF URIs, when we render any, we need to use the JRoute::_() method. This method converts normal URIs into SEF URIs; this will only happen if the component has a router and if the SEO options are enabled. In this example, we parse the URI index.php?option=com_boxoffice&layout=list into an SEF URI:

echo JRoute::_('index.php?option=com_boxoffice&layout=list');

This is an example of the output we might receive:

http://example.org/joomla/index.php/component/boxoffice/list ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required