Answer the question
In order to leave comments, you need to log in
Why is there an incorrect loading of data from the associated table into the select?
Good morning.
There is a form in which there is a select. Data from another table is loaded into this select. The table consists of id and name.
<?php echo $form->field($model, 'id_type')->dropdownList(Type::find()->
select(['name'])->indexBy('name')->column(), ['prompt'=>'Выберите услугу']);?>
select(['name'])->indexBy('id')
Answer the question
In order to leave comments, you need to log in
And if so?
ArrayHelper::map(Type::find()->select(['id','name'])->all(),'id','name')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question