简体   繁体   中英

How to make a correct Joomla URL using the Joomla Classes

I am busy making a Joomla! component. And know i want to link to another component. So, as example i want to link from my component 'my_component' to 'his_component'. Normally this is simple to do. Just make a normal link like href="?option=com_his_component". But the problem is that one of my consumers uses SEO friendly URLs. And in that case this URL won't work.

Does anyone know a way to this the correct way (I think with the Joomla! Api)

只需用对JRoute::_($url)的调用包装该链接即可:

$link = JRoute::_('index.php?option=com_his_component&foo=bar');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM