Answer the question
In order to leave comments, you need to log in
How to display a field through Grid yii2?
Hello,
Please tell me how to display the value field from the array using GridView::widget:
Thanks in advance.
[2] => Array
(
[country_id] => 336
[cities_count] => 0
[i18n] => Array
(
[0] => Array
(
[language] => ru
[object_type] => country
[object_id] => 336
[object_field] => name
[value] => Китай
[value_text] =>
)
)
)
Answer the question
In order to leave comments, you need to log in
'columns' => [
[
'attribute' => 'Название страны',
'content' => function(array $model) {
return $model['i18n'][0]['value'];
}
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question