Hi,
I’m using Yii2 to learn some php and build a web page with this framework. I have this issue I’m not sure what the best approach is. Since pasting code would not clarify things, I’ll describe what I want to achieve.
I have a controller Site with the index view and static pages.
I have a controller Game that shows games of a sports club with correspondig model Game.
On my Game index view i have a gridview of all games.
I would like to show on my index view (SiteController) the next game to be played. I assume I will be able to filter this on date, but currently it is unclear to me what the best way is to get this data from Game to my SiteController index view.
Where I have an action Index() with searchModel & dataProvider, I could create an action actionNextGame() and query the data i need in the GameSearch model, but i’m unsure how I can present it in the SiteController view.
Any ideas or tips or explanations how to proceed?
thanks in advance !
(PS: I based my project on Nenad’s basic template)