Posted By

guimarca on 12/09/15


Tagged

php YII2


Versions (?)

Yii2 dropwdown list filter in GridView


 / Published in: PHP
 

Put it in the columns array

  1. [
  2. 'attribute' => 'attribute_name',
  3. 'value' => 'attribute_value',
  4. 'filter' => Html::activeDropDownList($searchModel, 'attribute_name', ArrayHelper::map(ModelName::find()->asArray()->all(), 'ID', 'Name'),['class'=>'form-control','prompt' => 'Select Category']),
  5. ],

Report this snippet  

You need to login to post a comment.