1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterPosition' => '', 'layout' => '<div class="row"><div class="col-sm-12">{items}</div></div><div class="row"><div class="col-sm-5 text-center-xs text-left-not-xs">{summary}</div><div class="col-sm-7 text-center-xs text-right-not-xs">{pager}</div></div>', 'columns' => [ [ 'class' => 'yii\grid\SerialColumn', 'headerOptions' => ['class' => 'hidden-sm hidden-xs'], 'contentOptions' => ['class' => 'hidden-sm hidden-xs'], ], [ 'label' => 'ID', 'attribute' => 'id', 'value' => function ($data) { return Html::a($data->id, ['upload/view', 'id' => $data->id]); }, 'format' => 'raw', ], [ 'label' => 'Field1', 'attribute' => 'field1', 'format' => 'raw', ], [ 'label' => 'Image', 'attribute' => 'image', 'value' => function ($data) { return Html::a($data->file_name, Yii::$app->urlManagerFrontEnd->createAbsoluteUrl(['uploads/' . $data->file_name]), ['target' => '_blank']); }, 'format' => 'raw', ], [ 'label' => 'Created', 'attribute' => 'created', 'headerOptions' => ['class' => 'hidden-xs'], 'contentOptions' => ['class' => 'hidden-xs'], ], [ 'label' => 'Updated', 'attribute' => 'updated', 'headerOptions' => ['class' => 'hidden-sm hidden-xs'], 'contentOptions' => ['class' => 'hidden-sm hidden-xs'], ], [ 'class' => 'yii\grid\ActionColumn', 'template' => '{view} {delete}' ], ], ]); ?>
|