Menu
Menu
Table of Contents
Properties
- $identifier : string
- Menu Identifier
- $label : string
- Label of the Menu (useful for Selectbox menus)
- $menuItems : array<string|int, mixed>
- Container for menuitems
Methods
- addMenuItem() : mixed
- Adds a new menuItem
- getDataIdentifier() : string
- Get identifier for data attribute
- getIdentifier() : string
- Get identifier
- getLabel() : string
- Get the label
- getMenuItems() : array<string|int, mixed>
- Get menu items
- isValid() : bool
- Validation function
- makeMenuItem() : MenuItem
- MenuItem Factory Method
- setIdentifier() : Menu
- Set identifier
- setLabel() : Menu
- Set label
Properties
$identifier
Menu Identifier
protected
string
$identifier
= ''
$label
Label of the Menu (useful for Selectbox menus)
protected
string
$label
= ''
$menuItems
Container for menuitems
protected
array<string|int, mixed>
$menuItems
= []
Methods
addMenuItem()
Adds a new menuItem
public
addMenuItem(MenuItem $menuItem) : mixed
Parameters
- $menuItem : MenuItem
-
The menuItem to add to the menu
Tags
getDataIdentifier()
Get identifier for data attribute
public
getDataIdentifier() : string
Return values
stringgetIdentifier()
Get identifier
public
getIdentifier() : string
Return values
stringgetLabel()
Get the label
public
getLabel() : string
Return values
stringgetMenuItems()
Get menu items
public
getMenuItems() : array<string|int, mixed>
Return values
array<string|int, mixed>isValid()
Validation function
public
isValid(Menu $menu) : bool
Parameters
- $menu : Menu
-
The menu to validate
Return values
boolmakeMenuItem()
MenuItem Factory Method
public
makeMenuItem() : MenuItem
Return values
MenuItemsetIdentifier()
Set identifier
public
setIdentifier(string $identifier) : Menu
Parameters
- $identifier : string
-
Menu Identifier
Return values
MenusetLabel()
Set label
public
setLabel(string $label) : Menu
Parameters
- $label : string
-
LabelText for the menu (accepts LLL syntax)