【问题标题】:How to make a correct Joomla URL using the Joomla Classes如何使用 Joomla 类制作正确的 Joomla URL
【发布时间】:2011-05-28 10:19:08
【问题描述】:

我正忙着制作 Joomla!零件。并且知道我想链接到另一个组件。因此,作为示例,我想从我的组件“my_component”链接到“his_component”。通常这很容易做到。只需创建一个普通链接,如 href="?option=com_his_component"。但问题是我的一位消费者使用 SEO 友好的 URL。在这种情况下,此 URL 将不起作用。

有谁知道正确的方法(我认为是 Joomla!Api)

【问题讨论】:

    标签: php url joomla joomla1.5


    【解决方案1】:

    只需调用 JRoute::_($url) 来包装该链接:

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

    【讨论】:

      猜你喜欢
      • 2018-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-31
      • 1970-01-01
      • 2012-10-27
      相关资源
      最近更新 更多