Imagine I’d like to show on a grid the last 5 posts of a user. Each row of the grid shows a post. Additionally, for every post I’d like to have subrows, each one showing one person involved in the post at a time.
The models I have are Post and User. I mapped posts and users and pass it as an array to the CGridView with no luck.
So, is it posible to display data from more than one model on a CGridView?
I’m not terribly familiar with the CGridView but instead of using the CActiveDataProvider in your controller you could use a CSqlDataProvider and write a custom query. You’re not taking advantage of the model architecture then but it would allow you to do what you’re asking.