public function getCountries()
{
$countries = ArrayHelper::map(Countries::find()
->orderBy(['name' => SORT_ASC])
->asArray()
->all(), 'id', 'name');
return $countries;
}
ORDER BY id = 43 DESC, name ASC, но как это в yii сделать?
<?= $form
->field($model, 'country_id')
->dropDownList($countries, [
'class' => 'form-control chosen-select js__change-country',
'id' => 'input11',
'options' => [$model->country_id => ['Selected' => true]],
])
->label(false) ?>
id=43, как имя колонки)