Yii
1
Вклад в тег
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'title',
'author' => [
'class' => \yii\grid\DataColumn::className(),
'format' => 'html',
'value' => function ($model, $index, $widget) {
return $model->author->name ;
},
],
// и т.п. ...
public function getAuthor() {
return $this->hasOne(Authors::className(), ['id' => 'author_id']);
}