-2

すべてのメニューとその属性を出力するこの質問を読みました。1 つの特定のメニュー (3 つある) のすべてのタイトルとそのリンクを取得するにはどうすればよいですか?

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 に答える