Код: Выделить всё
['status', 'boolean'],
Код: Выделить всё
[
'class' => 'yii\grid\CheckboxColumn',
'checkboxOptions' => function ($model, $key, $index, $column) {
return ['value' => $model->status, 'checked' => $model->status];
}
],
Код: Выделить всё
checked => 0
Код: Выделить всё
checked => 1
Код: Выделить всё
[
'class' => 'yii\grid\CheckboxColumn',
'checkboxOptions' => function ($model, $key, $index, $column) {
return ['value' => $model->status, 'checked' => $model->status ? true : false];
}
],
Нашел корень проблемы:
Код: Выделить всё
gettype($model->status)
Но почему если в правилах он указан как boolean? Это особенность фреймворка или я что-то делаю не так?