\TbMenu

Bootstrap menu.

Summary

Methods
Properties
Constants
getDividerCssClass()
getDropdownCssClass()
isVertical()
init()
$type
$scrollspy
$stacked
$justified
$dropup
TYPE_TABS
TYPE_PILLS
TYPE_LIST
TYPE_NAVBAR
renderMenu()
renderMenuItem()
normalizeItems()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TYPE_TABS

TYPE_TABS

TYPE_PILLS

TYPE_PILLS

TYPE_LIST

TYPE_LIST

TYPE_NAVBAR

TYPE_NAVBAR

Properties

$type

$type : string

Type

string — the menu type. Valid values are 'tabs', 'pills', or 'list'.

$scrollspy

$scrollspy : string|array

Type

string|array — the scrollspy target or configuration.

$stacked

$stacked : boolean

Type

boolean — indicates whether the menu should appear vertically stacked.

$justified

$justified : boolean

Type

boolean — indicates whether the menu should be justified.

$dropup

$dropup : boolean

Type

boolean — indicates whether dropdowns should be dropups instead.

Methods

getDividerCssClass()

getDividerCssClass() : string

### .getDividerCssClass()

Returns the divider css class.

Returns

string —

the class name

getDropdownCssClass()

getDropdownCssClass() : string

### .getDropdownCssClass()

Returns the dropdown css class.

Returns

string —

the class name

isVertical()

isVertical() : boolean

### .isVertical()

Returns whether this is a vertical menu.

Returns

boolean —

the result

init()

init()

### .init()

Initializes the widget.

renderMenu()

renderMenu(array $items)

### .renderMenu()

Renders the menu items.

Parameters

array $items

menu items. Each menu item will be an array with at least two elements: 'label' and 'active'. It may have three other optional elements: 'items', 'linkOptions' and 'itemOptions'.

renderMenuItem()

renderMenuItem(array $item) : string

### .renderMenuItem()

Renders the content of a menu item. Note that the container and the sub-menus are not rendered here.

Parameters

array $item

the menu item to be rendered. Please see {@link items} on what data might be in the item.

Returns

string —

the rendered item

normalizeItems()

normalizeItems(array $items, string $route, boolean $active) : array

### .normalizeItems()

Normalizes the {@link items} property so that the 'active' state is properly identified for every menu item.

Parameters

array $items

the items to be normalized.

string $route

the route of the current request.

boolean $active

whether there is an active child menu item.

Returns

array —

the normalized menu items