Question

How to generate sef url in joomla3.1 component? My route is here.

my_component/view/categories/category/catID/itemID
Was it helpful?

Solution

To do this, you would use something like the following:

echo JRoute::_('index.php?option=com_mycomponent&view=categories&catid=20&Itemid=50');

Joomla will automatically turn this into a SEF URL using the JRoute() class.

For more information on supporting SEF URL's with your component, have a read of this:

http://docs.joomla.org/Supporting_SEF_URLs_in_your_component

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top