Answer the question
In order to leave comments, you need to log in
How to display data linked through an intermediate table in a gridview?
I display a list of users using gridview. But I would also like to add belonging to the role (each user has one role). It can be displayed through the item_name link, but I want to display a full-fledged record, description. How can this be implemented
Answer the question
In order to leave comments, you need to log in
[
'label' => 'Роль',
'value' => function($model){
return $model->authAssignment->authItem->description;
}
]
$query = User::find()->with([
'authAssignment' => function($q){
return $q->with('authItem');
}
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question