Joomla 3.1 - Get active menu item url

前端 未结 1 907
逝去的感伤
逝去的感伤 2021-01-14 09:16

As soon as I click on the \"Media\" item in my main menu, the following url is generated:

http://test.local/index.php/media-files

Now, I would like to creat

相关标签:
1条回答
  • 2021-01-14 09:35

    I think this might be what you want:

    $app  = JFactory::getApplication();
    $menu = $app->getMenu()->getActive()->link;
    
    echo JRoute::_($menu);
    

    I've tested this as well, so let me know if it's what you require.

    0 讨论(0)
提交回复
热议问题