yii\bootstrap\Nav::renderDropdown PHP Method

renderDropdown() protected method

This method is called to create sub-menus.
Since: 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.
return 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

Example #1
0
File: Nav.php Project: semnt/tp01
 protected function renderDropdown($items, $parentItem)
 {
     foreach ($items as &$item) {
         $this->changeItem($item);
     }
     return parent::renderDropdown($items, $parentItem);
 }