Documentation

MenuItemDto
in package

FinalYes
Tags
author

Javier Eguiluz javier.eguiluz@gmail.com

Table of Contents

Constants

TYPE_CRUD  = 'crud'
TYPE_DASHBOARD  = 'dashboard'
TYPE_EXIT_IMPERSONATION  = 'exit_impersonation'
TYPE_LOGOUT  = 'logout'
TYPE_ROUTE  = 'route'
TYPE_SECTION  = 'section'
TYPE_SUBMENU  = 'submenu'
TYPE_URL  = 'url'

Properties

$badge  : MenuItemBadgeDto|null
$cssClass  : string
$expanded  : bool
$icon  : string|null
$label  : TranslatableInterface|string|null
$linkRel  : string
$linkTarget  : string
$linkUrl  : string|null
$permission  : string|null
$routeName  : string|null
$routeParameters  : array<string|int, mixed>|null
$selected  : bool
$subItems  : array<string|int, MenuItemDto>
$translationParameters  : array<string|int, mixed>
$type  : string|null

Methods

getBadge()  : MenuItemBadgeDto|null
getCssClass()  : string
getIcon()  : string|null
getIndex()  : int
getLabel()  : TranslatableInterface|string
getLinkRel()  : string
getLinkTarget()  : string
getLinkUrl()  : string|null
getPermission()  : string|null
getRouteName()  : string|null
getRouteParameters()  : array<string|int, mixed>|null
getSubIndex()  : int
getSubItems()  : array<string|int, MenuItemDto>
getTranslationParameters()  : array<string|int, mixed>
getType()  : string
hasSubItems()  : bool
isExpanded()  : bool
isMenuSection()  : bool
isSelected()  : bool
setBadge()  : void
setCssClass()  : void
setExpanded()  : void
setIcon()  : void
setIndex()  : void
setLabel()  : void
setLinkRel()  : void
setLinkTarget()  : void
setLinkUrl()  : void
setPermission()  : void
setRouteName()  : void
setRouteParameter()  : void
setRouteParameters()  : void
setSelected()  : void
setSubIndex()  : void
setSubItems()  : void
setTranslationParameters()  : void
setType()  : void

Constants

TYPE_DASHBOARD

public mixed TYPE_DASHBOARD = 'dashboard'

TYPE_EXIT_IMPERSONATION

public mixed TYPE_EXIT_IMPERSONATION = 'exit_impersonation'

Properties

$routeParameters

private array<string|int, mixed>|null $routeParameters = null

$translationParameters

private array<string|int, mixed> $translationParameters = []

Methods

getCssClass()

public getCssClass() : string
Return values
string

getIcon()

public getIcon() : string|null
Return values
string|null

getIndex()

public getIndex() : int
Tags
deprecated

This was used in the past to get the selected menu item Now the active menu item is detected automatically via the Request data

Return values
int

getLinkRel()

public getLinkRel() : string
Return values
string

getLinkTarget()

public getLinkTarget() : string
Return values
string

getLinkUrl()

public getLinkUrl() : string|null
Return values
string|null

getPermission()

public getPermission() : string|null
Return values
string|null

getRouteName()

public getRouteName() : string|null
Return values
string|null

getRouteParameters()

public getRouteParameters() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getSubIndex()

public getSubIndex() : int
Tags
deprecated

This was used in the past to get the selected menu subitem Now the active menu item is detected automatically via the Request data

Return values
int

getTranslationParameters()

public getTranslationParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getType()

public getType() : string
Return values
string

hasSubItems()

public hasSubItems() : bool
Return values
bool

isExpanded()

public isExpanded() : bool
Return values
bool

Returns true when any of its subitems is selected

isMenuSection()

public isMenuSection() : bool
Return values
bool

isSelected()

public isSelected() : bool
Return values
bool

Returns true when this menu item is the selected one

setBadge()

public setBadge(mixed $content, string $style) : void
Parameters
$content : mixed
$style : string

setCssClass()

public setCssClass(string $cssClass) : void
Parameters
$cssClass : string

setExpanded()

public setExpanded(bool $isExpanded) : void
Parameters
$isExpanded : bool

setIcon()

public setIcon(string|null $icon) : void
Parameters
$icon : string|null

setIndex()

public setIndex(int $index) : void
Parameters
$index : int
Tags
deprecated

This was used in the past to set the selected menu item Now the active menu item is detected automatically via the Request data

setLinkRel()

public setLinkRel(string $linkRel) : void
Parameters
$linkRel : string

setLinkTarget()

public setLinkTarget(string $linkTarget) : void
Parameters
$linkTarget : string

setLinkUrl()

public setLinkUrl(string|null $linkUrl) : void
Parameters
$linkUrl : string|null

setPermission()

public setPermission(string|null $permission) : void
Parameters
$permission : string|null

setRouteName()

public setRouteName(string|null $routeName) : void
Parameters
$routeName : string|null

setRouteParameter()

public setRouteParameter(string $parameterName, mixed $parameterValue) : void
Parameters
$parameterName : string
$parameterValue : mixed

setRouteParameters()

public setRouteParameters(array<string|int, mixed>|null $routeParameters) : void
Parameters
$routeParameters : array<string|int, mixed>|null

setSelected()

public setSelected(bool $isSelected) : void
Parameters
$isSelected : bool

setSubIndex()

public setSubIndex(int $subIndex) : void
Parameters
$subIndex : int
Tags
deprecated

This was used in the past to set the selected menu subitem Now the active menu item is detected automatically via the Request data

setTranslationParameters()

public setTranslationParameters(array<string|int, mixed> $translationParameters) : void
Parameters
$translationParameters : array<string|int, mixed>

setType()

public setType(string $type) : void
Parameters
$type : string

        
On this page

Search results