如何在自己的组件中获取菜单项ID
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在自己的组件中获取菜单项ID相关的知识,希望对你有一定的参考价值。
Joomla SEF to work properly it is based on Joomla menus. In your own components for SEF to work and menus to appear your need to pass the Itemid to links. To do this you need to get the Itemid based on on the URL link. Here is how you get the Itemid by link.This code gets the Itemid of a menu link when you know the component and the view
$menu = &JSite::getMenu(); $menuItem = $menu->getItems( 'link', $url, true ); $Itemid = $menuItem->id;
以上是关于如何在自己的组件中获取菜单项ID的主要内容,如果未能解决你的问题,请参考以下文章
使用导航从工具栏菜单项单击在片段之间传递数据 - Kotlin