Latest news:

New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!

Yii2 Multi Select DropDown

in top of your model import array helper class

use yii\helpers\ArrayHelper;

in the model section we can populate the data this way.

public function getServices()
        $model = Services::find()->all();
        return $listData;

in the view section we need to use like that

    echo $form->field($model, 'services')->dropDownList($model->getServices(),

   ['class' => 'form-control', 'multiple' => true]);

Tags :

Views : 2

Recent Posts


Popular Tags


Subscribe Us

Follow Us