У меня проблема. У меня есть 3 выбора входа, которые я хочу заполнить теми же параметрами. Первый вход получает параметры, а два других - нет. Все перепробовала. Последнее, что я пробовал, это выбрать 3 разных запроса и заполнить каждый отдельно. К сожалению, у меня такая же проблема.
Спасибо за советы.
Контроллер
$dataPbxObj1 = Sipend::find()
->select('cc_sip_end.*')
->leftJoin('cc_reseller_to_pbx', '`cc_reseller_to_pbx`.`ID_PBX` = `cc_sip_end`.`id`')
->where(["in", "cc_reseller_to_pbx.id_cc_reseller", $reseller->id_cc_reseller])->all();
$dataPbxObj2 = Sipend::find()
->select('cc_sip_end.*')
->leftJoin('cc_reseller_to_pbx', '`cc_reseller_to_pbx`.`ID_PBX` = `cc_sip_end`.`id`')
->where(["in", "cc_reseller_to_pbx.id_cc_reseller", $reseller->id_cc_reseller])->all();
$dataPbxObj3 = Sipend::find()
->select('cc_sip_end.*')
->leftJoin('cc_reseller_to_pbx', '`cc_reseller_to_pbx`.`ID_PBX` = `cc_sip_end`.`id`')
->where(["in", "cc_reseller_to_pbx.id_cc_reseller", $reseller->id_cc_reseller])->all();
$dataPbx1 = ArrayHelper::map($dataPbxObj1,'id','popis');
$dataPbx2 = ArrayHelper::map($dataPbxObj2,'id','popis');
$dataPbx3 = ArrayHelper::map($dataPbxObj3,'id','popis');
Просмотр (все это выбирает такие же)
<?=$form->field($modelSip, 'ID_PBX')->widget(Select2::className(),
["data" => $dataPbx3,'hideSearch' => true]) ?>