php – Joomla! – 取得 menu 的列表與預選項目
可以指定你的 menutype 位置
1 2 3 4 |
$menu = JFactory::getApplication()->getMenu(); $items = $menu->getItems("menutype", "ch-top-menu"); |
當點選進入以後,若要知道目前的項目,可以使用
1 2 3 |
$curr = JFactory::getApplication()->getMenu()->getActive(); |