Chosen Select Widget based on Chosen jQuery plugin chosen, (*1)
, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
composer require yii2mod/yii2-chosen-select
or add, (*5)
"yii2mod/yii2-chosen-select": "^1.0"
to the require section of your composer.json., (*6)
Usage
1) Usage with ActiveForm and model, (*7)
echo $form->field($model, 'subject')->widget(\yii2mod\chosen\ChosenSelect::class, [
'items' => [
'first' => 'First',
'second' => 'Second'
],
]);
2) Usage without a model, (*8)
echo \yii2mod\chosen\ChosenSelect::widget([
'name' => 'select',
'items' => BooleanEnum::listData(),
'options' => [
'width' => '95%'
]
]);
Select Options
You can find them on the options page, (*9)
Support us
Does your business depend on our contributions? Reach out and support us on Patreon.
All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff., (*10)