<?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_id',
        'code',
        'date_add',
        [
            'value' => function($data) {
                return $data->user->firstname.' '.$data->user->lastname;
            },
            'header' => Yii::t('app', 'Author')
        ],
        [
            'class' => Column::className(),
            'header' => Yii::t('app', 'Name'),
            'content' => function($model, $key, $index, $column) {
                return $model->getArticleLangs()->where(['language_id' => Language::getDefaultLang()->language_id])->one()->name;
            }
        ],
        [
            'class' => ActionColumn::className(),
            'template' => '{update} {delete}'
        ]
    ]
]);