Chained version of Yii2 DropDownList widget.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist "himiklab/yii2-chained-dropdown-list-widget" "*"
or add
"himiklab/yii2-chained-dropdown-list-widget" : "*"
to the require section of your application's composer.json
file.
As field in ActiveForm:
use himiklab\chained\ChainedDropDownList;
<?= $form->field($model, 'news')->widget(
ChainedDropDownList::className(),
[
'remote' => [
'id' => 'language-drop-down',
'url' => Url::to('newsList')
]
]
); ?>
As inline field:
use himiklab\chained\ChainedDropDownList;
<?= ChainedDropDownList::widget([
'remote' => [
'id' => 'language-drop-down',
'url' => Url::to('newsList')
]
]); ?>
Comments