Blame view

common/modules/blog/views/category/index.php 764 Bytes
4253cbec   root   first commit
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
  <?php

  use yii\grid\ActionColumn;

  use yii\grid\Column;

  use yii\grid\GridView;

  use common\modules\blog\models\Article;

  use common\models\Language;

  echo GridView::widget([

      'dataProvider' => $dataProvider,

      'columns' => [

          'article_category_id',

          'code',

          'date_add',

          'date_update',

          [

              'class' => Column::className(),

              'header' => Yii::t('app', 'Name'),

              'content' => function($model, $key, $index, $column) {

                  return $model->getArticleCategoryLangs()->orderBy(['language_id' => 'ASC'])->one()->name;

              }

          ],

          [

              'class' => ActionColumn::className(),

              'template' => '{update} {delete}'

          ]

      ]

  ]);