In the my category table I have
ID
category_name
How do I display the category_name instead of ID in the Ticket index.php GridView.
Ticket model:
public function getCategory0()
{
return $this->hasOne(Category::className(), ['id' => 'category_id']);
}
I have tried doing
[
'attribute' => 'category_id',
'value' => 'category.name'
],
But the results gives me a value "Not Set" instead of the category_name