Use search Model to search for. Not to write a category for search did this.
<?= $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(Category::find()->all(), 'id','name'),['style'=>'font-family: \\'Exo 2\\', sans-serif; color: #0f0f0f; font-size:17px'])->label('Department')?>
But the point is, always list the first branch is active. T e, it will search according to this parameter. But how to do so initially the option was not there?