Class dmstr\widgets\Menu

Inheritancedmstr\widgets\Menu » yii\widgets\Menu

Class Menu Theme menu widget.

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
isItemActive() Checks whether a menu item is active. dmstr\widgets\Menu
normalizeItems() dmstr\widgets\Menu
renderItem() dmstr\widgets\Menu
renderItems() Recursively renders the menu items (without the container tag). dmstr\widgets\Menu

Property Details

$activateParents public property
public $activateParents true
$linkTemplate public property
public $linkTemplate '<a href="{url}">{icon} {label}</a>'
$submenuTemplate public property
public $submenuTemplate "\n<ul class='treeview-menu' {show}>\n{items}\n</ul>\n"

Method Details

isItemActive() protected method

Checks whether a menu item is active.

This is done by checking if \dmstr\widgets\route and \dmstr\widgets\params match that specified in the url option of the menu item. When the url option of a menu item is specified in terms of an array, its first element is treated as the route for the item and the rest of the elements are the associated parameters. Only when its route and parameters match \dmstr\widgets\route and \dmstr\widgets\params, respectively, will a menu item be considered active.

protected boolean isItemActive ( $item )
$item array

The menu item to be checked

return boolean

Whether the menu item is active

normalizeItems() protected method

protected void normalizeItems ( $items, &$active )
$items
$active
renderItem() protected method

protected void renderItem ( $item )
$item
renderItems() protected method

Recursively renders the menu items (without the container tag).

protected string renderItems ( $items )
$items array

The menu items to be rendered recursively

return string

The rendering result