Skip to content

Extract method in Yii bootstrap #4450

@bryglen

Description

@bryglen

https://github.com/yiisoft/yii2/blob/master/extensions/bootstrap/Nav.php#L173

can we extract the Dropdown::widget() into another function

I want to achieve is this

$items = Dropdown::widget([
    'options' => ArrayHelper::getValue($item, 'dropdownOptions'),
    'items' => $items,
    'encodeLabels' => $this->encodeLabels,
    'clientOptions' => false,
    'view' => $this->getView(),
 ]);

I want to add a customize class on the dropdown widget, I am subclassing the Nav class but I need to copy and paste the whole function of renderItem(), we can create method such as renderSubitem()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions