我正在使用GET方法将cat_id值返回到URL,以便指定我的下拉列表中必须选择哪个项目。 但它没有起作用。
<?= $form->field($model, 'cat_id')->dropDownList(
ArrayHelper::map(DeviceCats::find()
->where(['is_deleted' => 'no'])->all(),'id','title')
,['options' => [$_GET['cat_id'] => ['selected'=>true]]
, 'prompt' => ' -- Select Category --']) ?>