Код: Выделить всё
yii\helpers\Html::dropDownList( $name, $selection = null, $items = [], $options = [] )
При следующем коде:
Код: Выделить всё
<?= yii\helpers\Html::dropDownList('city', 0, $model->select(), ['id'=>"baz-city", 0 => ['disabled' => true]]) ?>
PHP Warning – yii\base\ErrorException
htmlspecialchars() expects parameter 1 to be string, array given
В документации:
Но, могу и ошибаться...options: array, the attributes for the select option tags. The array keys must be valid option values, and the array values are the extra attributes for the corresponding option tags. For example,
[
'value1' => ['disabled' => true],
'value2' => ['label' => 'value 2'],
];