I am developing my first Joomla component and am having trouble understandin开发者_如何学运维g how to insert a link to edit a item in my component.
Let's say I wanted to list an item and add a link to edit it. I'm not sure if I can just write a link with normal HTML, although that doesn't make so much sense could how could you make sure the link is correct if you make any changes or use SEF urls.
So basically what is the format for creating a link to a different task in your component?
Whenever making links in your component remember to always pass it through the JRoute Joomla function:
echo JRoute::_('index.php?option=com_foo&view=man&task=chu');
This will ensure that when you turn on SEF urls for Joomla that the URLs will be converted to their SEF counterparts. Please note that your component URLs will not be converted if you do not develop a router.php file for your component.
精彩评论