Class humhub\modules\ui\menu\MenuLink

Inheritancehumhub\modules\ui\menu\MenuLink » humhub\modules\ui\menu\MenuEntry » yii\base\BaseObject
Available since version1.4

Class MenuLink

Used to render menu link entries.

See also humhub\modules\ui\menu\widgets\Menu.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
compare() humhub\modules\ui\menu\MenuLink
createByArray() Creates MenuEntry by old and deprecated array structure humhub\modules\ui\menu\MenuLink
getHtmlOptions() humhub\modules\ui\menu\MenuLink
getIcon() humhub\modules\ui\menu\MenuLink
getId() humhub\modules\ui\menu\MenuEntry
getIsActive() humhub\modules\ui\menu\MenuEntry
getLabel() humhub\modules\ui\menu\MenuLink
getLink() humhub\modules\ui\menu\MenuLink
getSortOrder() humhub\modules\ui\menu\MenuEntry
getUrl() Returns the URL humhub\modules\ui\menu\MenuLink
isActiveState() humhub\modules\ui\menu\MenuEntry
isPjaxEnabled() humhub\modules\ui\menu\MenuLink
isVisible() humhub\modules\ui\menu\MenuEntry
render() Public accessible render function responsible for rendering this entry. humhub\modules\ui\menu\MenuEntry
renderEntry() Renders the link tag for this menu entry humhub\modules\ui\menu\MenuLink
setHtmlOptions() humhub\modules\ui\menu\MenuLink
setIcon() humhub\modules\ui\menu\MenuLink
setId() humhub\modules\ui\menu\MenuEntry
setIsActive() humhub\modules\ui\menu\MenuEntry
setIsActiveState() Activates this MenuEntry in case the given moduleId, controllerId and actionId matches the current request. humhub\modules\ui\menu\MenuEntry
setIsVisible() humhub\modules\ui\menu\MenuEntry
setLabel() humhub\modules\ui\menu\MenuLink
setLink() humhub\modules\ui\menu\MenuLink
setPjaxEnabled() humhub\modules\ui\menu\MenuLink
setSortOrder() humhub\modules\ui\menu\MenuEntry
setUrl() Sets the URL humhub\modules\ui\menu\MenuLink
toArray() Returns the MenuEntry as array structure humhub\modules\ui\menu\MenuLink

Property Details

$label protected property

The label of the menu entry

protected string $label null
protected humhub\widgets\Link $link null
$url protected property

The url or route

protected string|array $url null

Method Details

compare() public method

public void compare ( humhub\modules\ui\menu\MenuEntry $entry )
$entry
createByArray() public static method
Deprecated since 1.4

Creates MenuEntry by old and deprecated array structure

Note: In the array icons must be provided in legacy html format.

public static humhub\modules\ui\menu\MenuLink createByArray ( $item )
$item
getHtmlOptions() public method

public void getHtmlOptions ( $extraOptions = [] )
$extraOptions
getIcon() public method

public humhub\modules\ui\icon\widgets\Icon getIcon ( )
return humhub\modules\ui\icon\widgets\Icon

The icon

getLabel() public method

public string getLabel ( )
return string

The label

getLink() public method

public humhub\widgets\Link getLink ( )
getUrl() public method

Returns the URL

public array|string getUrl ( $asString true )
$asString boolean

Return the URL as string

isPjaxEnabled() public method

public boolean isPjaxEnabled ( )
renderEntry() public method

Renders the link tag for this menu entry

public string renderEntry ( $extraHtmlOptions = [] )
$extraHtmlOptions array
return string

The Html link

setHtmlOptions() public method

public static setHtmlOptions ( $htmlOptions )
$htmlOptions array
setIcon() public method

public void setIcon ( $icon, $right false, $raw false )
$icon

Icon|string the icon instance or icon name

  • @return static
$right
$raw
throws Exception
setLabel() public method

public static setLabel ( $label )
$label

String the label

setLink() public method

public static setLink ( humhub\widgets\Link $link )
$link

Link the label

setPjaxEnabled() public method

public static setPjaxEnabled ( $pjaxEnabled )
$pjaxEnabled boolean
setUrl() public method

Sets the URL

public static setUrl ( $url )
$url

Array|string

toArray() public method
Deprecated since 1.4

Returns the MenuEntry as array structure

public array toArray ( )
return array

The menu entry array representation