addArray() public method

Add an item to the menu array.
public addArray ( array $item ) : integer
$item array The item to add. Valid keys:
'class' - (string) CSS classname.
'icon' - (string) Filename of the image icon.
'icon_path' - (string) Non-default directory path for icon.
'onclick' - (string) Onclick javascript.
'target' - (string) HREF target parameter.
'text' - (string) Label.
'url' - (string) Hyperlink.
return integer The id (NOT guaranteed to be an array index) of the item just added to the menu.
示例#1
0
文件: Hylax.php 项目: horde/horde
 function getMenu($returnType = 'object')
 {
     global $registry;
     $menu = new Horde_Menu();
     $menu->addArray(array('url' => Horde::url('summary.php'), 'text' => _("Summary"), 'icon' => 'fax.png'));
     $menu->addArray(array('url' => Horde::url('folder.php'), 'text' => _("Folders"), 'icon' => 'folder.png'));
     $menu->addArray(array('url' => Horde::url('compose.php'), 'text' => _("Compose"), 'icon' => 'compose.png'));
     if ($returnType == 'object') {
         return $menu;
     } else {
         return $menu->render();
     }
 }