I’m developing a grid and I need to display the record from the DB that has many results.
For example I want to get shipped items that contains job_id 1. So the Shipped Items table has many records with id 1 and I want to display the quantity of those items in my grid.
This is what I have so far:
Model:
public function getShippedItems()
{
return $this->hasMany(ShippedItems::className(), ['job_id' => 'id']);
}
My view:
[
'value'=>'shippedItems',
]
And this is the error that I’m getting:
htmlspecialchars() expects parameter 1 to be string, array given