I’m rebuilding one of my sites and I’m using Yii framework for the first time.
In a couple of hours I could do so much that I’m really a fan of Yii and its easyness to code to.
But now, I’m facing a problem and I’m asking here so that someone can put some light on my path.
I’m rebuilding this old page: mypsntrophies.com/profile/KlotX into Yii, and I have 3 database tables with their respective relationship tables supporting this page (user, user_trophies, trophies, user_games, games) , but to translate it to MVC, I’m not getting to the point on how to do this.
So, I need to have 3 models (?) being loaded in one controller to be presented in one view.
And defining relations might be exactly the perfect solution for this, I just need to test it out since I don’t want to get all the user relations (trophies, games, etc) when for instance getting only the user information, nevertheless, it might also be a different model.
I’ll try to come up with a solution and then I’ll post here if it worked or not.
And in my view I want to use a CDetailView to show the $model and a CGridView to show $model->games, but as $model->games is an array I don’t know how to put it as a CActiveDataProvider and build the CGridView.