yii\bootstrap\Nav::renderDropdown PHP Метод

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

This method is called to create sub-menus.
С версии: 2.0.1
protected renderDropdown ( array $items, array $parentItem ) : string
$items array the given items. Please refer to [[Dropdown::items]] for the array structure.
$parentItem array the parent item information. Please refer to [[items]] for the structure of this array.
Результат string the rendering result.
    protected function renderDropdown($items, $parentItem)
    {
        /** @var Widget $dropdownClass */
        $dropdownClass = $this->dropdownClass;
        return $dropdownClass::widget(['options' => ArrayHelper::getValue($parentItem, 'dropDownOptions', []), 'items' => $items, 'encodeLabels' => $this->encodeLabels, 'clientOptions' => false, 'view' => $this->getView()]);
    }

Usage Example

Пример #1
0
Файл: Nav.php Проект: semnt/tp01
 protected function renderDropdown($items, $parentItem)
 {
     foreach ($items as &$item) {
         $this->changeItem($item);
     }
     return parent::renderDropdown($items, $parentItem);
 }