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
throws
InvalidArgumentException

In case a menuItem is not valid

getDataIdentifier()

Get identifier for data attribute

public getDataIdentifier() : string
Return values
string

getIdentifier()

Get identifier

public getIdentifier() : string
Return values
string

getLabel()

Get the label

public getLabel() : string
Return values
string

getMenuItems()

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
bool

setIdentifier()

Set identifier

public setIdentifier(string $identifier) : Menu
Parameters
$identifier : string

Menu Identifier

Return values
Menu

setLabel()

Set label

public setLabel(string $label) : Menu
Parameters
$label : string

LabelText for the menu (accepts LLL syntax)

Return values
Menu

        
On this page

Search results