query->createCommand()->rawSQL);
//print_a($dataProvider->getModels());
//$dataProvider->getModels()->toArray([]);exit;
$this->title = 'Содержимое слайдера';
$this->params['breadcrumbs'][] = $this->title;
?>
= Html::a('Добавить новость', ['create'], ['class' => 'btn btn-success']) ?>
= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute'=>'новость',
'value' => 'post_id'
],
[
'attribute' => 'Фото',
'format' => 'html',
'value' => function ($model) {return Html::img(Yii::getAlias('@web').'/images/news/news/'. $model['id'].".jpg", ['width' => '90px']);},
],
[
'attribute'=>'Заголовок',
'format' => 'html',
'value' => function ($model) {return Html::a( $model['title'], '/news/'.$model['id'] );},
],
[
'attribute'=>'Дата начала',
'value' => 'published_from',
],
[
'attribute'=>'Дата окончания',
'value' => 'published_to',
],
[
'class' => ActionColumn::className(),
'urlCreator' => function ($action, $model, $key, $index, $column) {
return Url::toRoute([$action, 'id' => $model['ts_id']]);
}
],
],
]); ?>