989c83b0
Yarik
test
|
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
|
<h1><?= $this->title ?></h1>
<p>
<?= Html::a(Yii::t('app', 'Добавить'), [ 'gallery-create' ], [ 'class' => 'btn btn-success' ]) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'gallery_id',
'label' => 'ID',
],
'name',
'date_add',
[
'attribute' => 'type',
'value' => function($model, $key, $index, $column) {
switch($model->type) {
case 2:
return 'Видео';
break;
default:
return 'Фото';
break;
}
},
'label' => 'Фото или Видео',
'filter' => [
1 => 'Фото',
2 => 'Видео',
]
],
],
]) ?>
|