-2

我已经阅读了这个输出所有菜单及其属性的问题。如何获取一个特定菜单(我有三个)的所有标题及其链接?

4

1 回答 1

1
// Get default menu - JMenu object
$name='blah'; //Name of your menu alias here
$menu = JFactory::getApplication()->getMenu($name);

// Get menu items - array with menu items
$items = $menu->getMenu();

// Look through the menu structure, once you understand it
// do a loop and find the link that you need.
var_dump($items);

希望这可以帮助

于 2012-11-14T17:18:46.873 回答