title = 'News'; $this->params['breadcrumbs'][] = $this->title; ?>
= Html::a('Добавить News', ['create'], ['class' => 'btn btn-success']) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], //'id', 'name', //'code', // 'brief:ntext', //'content:ntext', //'sort_delete', //'title', //'kwords', //'descr', [ 'format' => 'raw', 'filter' => [ '1'=>'Отображаются', '0'=>'Скрытые', ], 'value' => function($data){ if($data->is_active){ $status_img = ''; } else { $status_img = ''; } return $status_img; }, 'attribute'=>'is_active', ], //'mail_send', 'mails_count', [ 'format' => 'image', 'attribute'=>'img', ], [ 'label' =>'Дата', 'value' =>function ($data) { return date('Y-m-d', $data->dt); }, 'attribute' => 'dt', 'filter' => DatePicker::widget([ 'model' =>$searchModel, 'language' =>'ru', 'size' =>'xs', 'separator' =>'', 'attribute' => 'dt', 'value'=> '', 'type' => DatePicker::TYPE_RANGE, 'value2'=> date('dd-M-yyyy'), 'attribute2' => 'date_to', ]), ], ['class' => 'yii\grid\ActionColumn'], ], ]); ?>