PHP Класс macgyer\yii2materializecss\widgets\Dropdown

For example, php Please make sure that you provide the trigger with a data-activates attribute and specify the value of this attribute in the [[toggleTarget]] property of the widget.
См. также: http://materializecss.com/navbar.html#navbar-dropdown
Автор: Christoph Erdmann ([email protected])
Наследование: extends macgyer\yii2materializecss\lib\BaseWidget
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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 - url: string|array, optional, the url of the item link. This will be processed by yii\helpers\Url::to()-detail). 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 a divider use
  • .
    $submenuOptions the HTML attributes for sub-menu container tags. If not set - [[options]] value will be used for it.
    $toggleTarget the HTML id of the dropdown. This property specifies the target which shall be activated by the dropdown trigger. If you defined the following trigger Dropdown your [[toggleTarget]] has to be set to "dropdown1".

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

    Метод Описание
    init ( ) Initializes the widget.
    run ( ) : string Renders the widget and registers the plugin asset.

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

    Метод Описание
    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 and registers the plugin asset.
    public run ( ) : string
    Результат string the result of widget execution to be outputted.

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

    $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 - url: string|array, optional, the url of the item link. This will be processed by yii\helpers\Url::to()-detail). 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 a divider use
  • .
    public $items

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

    the HTML attributes for sub-menu container tags. If not set - [[options]] value will be used for it.
    public $submenuOptions

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

    the HTML id of the dropdown. This property specifies the target which shall be activated by the dropdown trigger. If you defined the following trigger Dropdown your [[toggleTarget]] has to be set to "dropdown1".
    public $toggleTarget