2

Hi I have developed a custom component for Joomla 1.5. However the urls when SEF is turned on could look a bit better e.g. display the title rather than the id, how can I make custom urls for my component when SEF for Joomla is turned on?

Martin
  • 10,294
  • 11
  • 63
  • 83

2 Answers2

2

Have you looked in to the Joomla routing methods? http://docs.joomla.org/Routing

Jeepstone
  • 2,591
  • 5
  • 22
  • 38
1

You Can use JRoute class as follows:

JRoute::_( $url, $xhtml = true, $ssl=null );

$url is a string containing the absolute or relative internal Joomla! URL.

$xhtml is a boolean value that specifies whether or not the output should be in XHTML. This parameter is optional and if omitted defaults to true.

$ssl is an integer value that specifies whether the URI should be secure. It should be set to 1 to force the URI to be secure using the global secure site URI, 0 to leave it in the same state as when it was passed, and -1 to force the URI to be unsecure using the global unsecure site URI.

The most important parameter is $url. A call to this method might look like:

JRoute::_( 'index.php?view=article&id='.$[itemID] );
Moamen Mostafa
  • 349
  • 3
  • 6