[英]Joomla! Rewrite dynamic URL
I am working in a component to Joomla! 我正在为Joomla开发组件! 3 but I am having a litle issue.
3,但我遇到了麻烦。
I have this: $primary_link->setUrl(JRoute::_('index.php?option=com_sweetmail&task=item&item_id=' . $item->getId(), false));
我有这个:
$primary_link->setUrl(JRoute::_('index.php?option=com_sweetmail&task=item&item_id=' . $item->getId(), false));
that creates URL something like: http:://www.mysite.com/component/sweetmail/item/example
. 会创建类似以下网址的URL:
http:://www.mysite.com/component/sweetmail/item/example
。
What I am trying to do is rewrite JRoute dynamically, to delete /component/sweetmmail/item
我想做的是动态重写JRoute,以删除
/component/sweetmmail/item
Is this possible? 这可能吗?
You will need a router.php for the sweetmail component. 您将需要sweetmail组件的router.php。 Currently you don't have one.
目前您还没有。 Check the router.php under the com_banners component to see how it's done.
检查com_banners组件下的router.php,看看它是如何完成的。 Essentially you will need to to create and to parse the URL.
本质上,您将需要创建并解析URL。 Not that complicated.
没有那么复杂。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.