$items
$items : array<mixed,\Charcoal\Ui\MenuItem\MenuItemInterface>
A collection menu items.
A Generic Menu
Concreete implementation of \Charcoal\Ui\Menu\MenuInterface.
$items : array<mixed,\Charcoal\Ui\MenuItem\MenuItemInterface>
A collection menu items.
$menuItemBuilder : \Charcoal\Ui\MenuItem\MenuItemBuilder
Store a menu builder instance.
setMenuItemBuilder(\Charcoal\Ui\MenuItem\MenuItemBuilder $menuItemBuilder) : \Charcoal\Ui\Menu\AsbtractMenu
\Charcoal\Ui\MenuItem\MenuItemBuilder | $menuItemBuilder | The Menu Item Builder that will be used to create new items. |
Chainable
setItemCallback(callable $cb) : \Charcoal\Ui\Menu\AbstractMenu
callable | $cb | The item callback. |
Chainable
setItems(array $items) : \Charcoal\Ui\Menu\AbstractMenu
array | $items | The menu items. |
Chainable
addItem(array|\Charcoal\Ui\MenuItem\MenuItemInterface $item) : \Charcoal\Ui\Menu\MenuItem
array|\Charcoal\Ui\MenuItem\MenuItemInterface | $item | A menu item structure or object. |
If the item argument is not a structure or object.
Chainable
items(callable $itemCallback = null) : array<mixed,\Charcoal\Ui\MenuItem\MenuItemInterface>
Menu Item generator.
callable | $itemCallback | Optional. Item callback. |
setActive(boolean $active) : \Charcoal\Ui\AbstractUiItem
Activates/deactivates the UI item.
boolean | $active | Activate (TRUE) or deactivate (FALSE) the UI item. |
Chainable
setType(string|null $type) : \Charcoal\Ui\UiItemInterface
Set the UI item type.
string|null | $type | The UI item type. |
If the type is not a string.
Chainable
setTemplate(string $template) : \Charcoal\Ui\UiItemInterface
Set the UI item's template.
Usually, a path to a file containing the template to be rendered.
string | $template | A template (identifier). |
If the template is not a string.
Chainable
setTitle(mixed $title) : \Charcoal\Ui\UiItemInterface
Set the UI item's title.
mixed | $title | A title. |
Chainable
setSubtitle(mixed $subtitle) : \Charcoal\Ui\UiItemInterface
Set the UI item's sub-title.
mixed | $subtitle | A sub-title. |
Chainable
setDescription(mixed $description) : \Charcoal\Ui\UiItemInterface
Set the UI item's description.
mixed | $description | A description. |
Chainable
setNotes(mixed $notes) : \Charcoal\Ui\UiItemInterface
Set notes about the UI item.
mixed | $notes | Notes. |
Chainable
setShowTitle(boolean $show) : \Charcoal\Ui\UiItemInterface
Show/hide the UI item's title.
boolean | $show | Show (TRUE) or hide (FALSE) the title. |
Chainable
setShowSubtitle(boolean $show) : \Charcoal\Ui\UiItemInterface
Show/hide the UI item's sub-title.
boolean | $show | Show (TRUE) or hide (FALSE) the sub-title. |
Chainable
setShowDescription(boolean $show) : \Charcoal\Ui\UiItemInterface
Show/hide the UI item's description.
boolean | $show | Show (TRUE) or hide (FALSE) the description. |
Chainable
setShowNotes(boolean $show) : \Charcoal\Ui\UiItemInterface
Show/hide the UI item's notes.
boolean | $show | Show (TRUE) or hide (FALSE) the notes. |
Chainable
setShowHeader(boolean $show) : \Charcoal\Ui\UiItemInterface
Show/hide the UI item's header.
boolean | $show | Show (TRUE) or hide (FALSE) the header. |
Chainable
setShowFooter(boolean $show) : \Charcoal\Ui\UiItemInterface
Show/hide the UI item's footer.
boolean | $show | Show (TRUE) or hide (FALSE) the footer. |
Chainable
setIcon(string $icon) : \Charcoal\Ui\UiItemInterface
Set the path to the item's icon associated with the object.
string | $icon | A path to an image. |
Chainable
sortItemsByPriority(\Charcoal\Ui\MenuItem\MenuItemInterface $a, \Charcoal\Ui\MenuItem\MenuItemInterface $b) : integer
Static comparison function used by {@see uasort()}.
\Charcoal\Ui\MenuItem\MenuItemInterface | $a | Menu A. |
\Charcoal\Ui\MenuItem\MenuItemInterface | $b | Menu B. |
Sorting value: -1, 0, or 1