Answer the question
In order to leave comments, you need to log in
Is it possible to pass a value for the dropDownList field?
I deduce dropDownList, in it the list and the first empty field. Can value be set to a value? It goes empty.<option value="">Выберите поле</option>
<?= $form->field($model, 'param')->dropDownList(ArrayHelper::map($array,'id','name'), ['prompt' => 'Выберите поле ']);
?>
Answer the question
In order to leave comments, you need to log in
the only way:
$values = ArrayHelper::map($array,'id','name');
$values[<нужное значение>] = 'Выберите поле ';
$form->field($model, 'param')->dropDownList($values);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question