Blame view

backend/views/page/index.php 1.41 KB
d8c1a2e0   Yarik   Big commit artbox
1
  <?php
824ca43a   Alexey Boroda   -Pages update (ad...
2
3
4
5
6
7
8
9
10
11
12
13
14
      
      use common\models\Page;
      use yii\helpers\Html;
      use yii\grid\GridView;
      
      /**
       * @var  yii\web\View                $this
       * @var  common\models\PageSearch    $searchModel
       * @var  yii\data\ActiveDataProvider $dataProvider
       */
      
      $this->title = \Yii::t('app', 'Pages');
      $this->params[ 'breadcrumbs' ][] = $this->title;
d8c1a2e0   Yarik   Big commit artbox
15
16
  ?>
  <div class="page-index">
824ca43a   Alexey Boroda   -Pages update (ad...
17
      
d8c1a2e0   Yarik   Big commit artbox
18
      <h1><?= Html::encode($this->title) ?></h1>
824ca43a   Alexey Boroda   -Pages update (ad...
19
      
d8c1a2e0   Yarik   Big commit artbox
20
      <p>
824ca43a   Alexey Boroda   -Pages update (ad...
21
          <?= Html::a(\Yii::t('app', 'Create Page'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
d8c1a2e0   Yarik   Big commit artbox
22
23
24
      </p>
      <?= GridView::widget([
          'dataProvider' => $dataProvider,
824ca43a   Alexey Boroda   -Pages update (ad...
25
26
          'filterModel'  => $searchModel,
          'columns'      => [
d8c1a2e0   Yarik   Big commit artbox
27
              'id',
824ca43a   Alexey Boroda   -Pages update (ad...
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
              [
                  'attribute' => 'title',
                  'value'     => 'lang.title',
              ],
              [
                  'attribute' => 'in_menu',
                  'value'     => function($model) {
                      /**
                       * @var Page $model
                       */
                      return ( !$model->in_menu ) ? \Yii::t('app', 'Не в меню') : \Yii::t('app', 'В меню');
                  },
                  'filter'    => [
                      0 => \Yii::t('app', 'Не в меню'),
                      1 => \Yii::t('app', 'В меню'),
                  ],
              ],
              [ 'class' => 'yii\grid\ActionColumn' ],
d8c1a2e0   Yarik   Big commit artbox
46
47
48
          ],
      ]); ?>
  </div>