Код: Выделить всё
class Orders extends ActiveRecord
{
// ------------------------------------------
public function getStatus($value)
{
switch ($value) {
case '0': return 'Новый заказ';
case '1': return 'Ожидает проверки';
case '2': return 'Выполнен';
case '3': return 'Отправлен';
case '4': return 'Отменен';
case '5': return 'Возврат';
}
}
}
Код: Выделить всё
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'name',
'email:email',
'phone',
'address:ntext',
'date_created',
'date_updated',
[
'attribute' => 'status',
'value' => '', // ??????????????????
'format' => 'html'
],
['class' => 'yii\grid\ActionColumn'],
],
]); ?>