use yii\helpers\Html;
use yii\grid\GridView;
$this->title = 'Заказы';
$this->params['breadcrumbs'][] = $this->title;
?>
Заказы
= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'id',
'value'=>'id',
//'contentOptions'=>['style'=>'width: 160px;']
],
[
'attribute' => 'date_time',
'value'=>'date_time',
//'contentOptions'=>['style'=>'width: 160px;']
],
[
'attribute' => 'surname',
'value'=>'surname',
//'contentOptions'=>['style'=>'max-width: 300px;']
],
[
'attribute' => 'name',
'value'=>function($data){
return Html::a($data->name, ['/admin/orders/show','id'=>$data->id]);
},
'format'=>'raw',
],
[
'attribute' => 'phone',
'value'=>'phone',
//'contentOptions'=>['style'=>'max-width: 300px;']
],
[
'attribute' => 'total',
'value'=>'total',
//'contentOptions'=>['style'=>'max-width: 300px;']
],
[
'attribute' => 'status',
'value'=>'status',
'contentOptions'=>['style'=>'width: 5px;']
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{delete}',
'contentOptions'=>['style'=>'width: 70px;']
],
],
]) ?>