PHP Класс yii\bootstrap\Dropdown

См. также: http://getbootstrap.com/javascript/#dropdowns
С версии: 2.0
Автор: Antonio Ramirez ([email protected])
Наследование: extends yii\bootstrap\Widget
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$encodeLabels whether the labels for header items should be HTML-encoded.
$items list of menu items in the dropdown. Each array element can be either an HTML string, or an array representing a single menu with the following structure: - label: string, required, the label of the item link. - encode: boolean, optional, whether to HTML-ecnode item label. - url: string|array, optional, the url of the item link. This will be processed by [[Url::to()]]. If not set, the item will be treated as a menu header when the item has no sub-menu. - visible: boolean, optional, whether this menu item is visible. Defaults to true. - linkOptions: array, optional, the HTML attributes of the item link. - options: array, optional, the HTML attributes of the item. - items: array, optional, the submenu items. The structure is the same as this property. Note that Bootstrap doesn't support dropdown submenu. You have to add your own CSS styles to support it. - submenuOptions: array, optional, the HTML attributes for sub-menu container tag. If specified it will be merged with [[submenuOptions]]. To insert divider use .
$submenuOptions the HTML attributes for sub-menu container tags. If not set - [[options]] value will be used for it.

Открытые методы

Метод Описание
init ( ) Initializes the widget.
run ( ) Renders the widget.

Защищенные методы

Метод Описание
renderItems ( array $items, array $options = [] ) : string Renders menu items.

Описание методов

init() публичный Метод

If you override this method, make sure you call the parent implementation first.
public init ( )

renderItems() защищенный Метод

Renders menu items.
protected renderItems ( array $items, array $options = [] ) : string
$items array the menu items to be rendered
$options array the container HTML attributes
Результат string the rendering result.

run() публичный Метод

Renders the widget.
public run ( )

Описание свойств

$encodeLabels публичное свойство

whether the labels for header items should be HTML-encoded.
public $encodeLabels

$items публичное свойство

list of menu items in the dropdown. Each array element can be either an HTML string, or an array representing a single menu with the following structure: - label: string, required, the label of the item link. - encode: boolean, optional, whether to HTML-ecnode item label. - url: string|array, optional, the url of the item link. This will be processed by [[Url::to()]]. If not set, the item will be treated as a menu header when the item has no sub-menu. - visible: boolean, optional, whether this menu item is visible. Defaults to true. - linkOptions: array, optional, the HTML attributes of the item link. - options: array, optional, the HTML attributes of the item. - items: array, optional, the submenu items. The structure is the same as this property. Note that Bootstrap doesn't support dropdown submenu. You have to add your own CSS styles to support it. - submenuOptions: array, optional, the HTML attributes for sub-menu container tag. If specified it will be merged with [[submenuOptions]]. To insert divider use .
public $items

$submenuOptions публичное свойство

the HTML attributes for sub-menu container tags. If not set - [[options]] value will be used for it.
С версии: 2.0.5
public $submenuOptions