How do you put the name Yii2 instead of the number? GridView
-
Available GridViewbut the categories are numerical. How do you remove names from another table - categories instead of those figures for Category_id-Title? It's very difficult to give Yii2.
What do I have to write in the code? I tried differently, and http://www.elisdn.ru/blog/76/seo-service-on-yii2-admin-and-sef I took, and http://nix-tips.ru/yii2-razbiraemsya-s-gridview.html ♪ But it ended with mistakes. Thank you for your help!
-
[ 'attribute' => 'category_id', 'filter' => Html::activeDropDownList( $searchModel, 'category_id', ArrayHelper::map(Category::find()->all(), 'id', 'name'), ['class' => 'form-control'] ), 'value' => 'category.name', ]
This method still works, don't pay attention to the filter.
'value' => 'category.name'
♪ I don't know if it's more beautiful than the previous one, but I'm new. Works like that, tells me who's old at what's the difference?