[eluser]johnpeace[/eluser]
[quote author="xerosis" date="1299027919"]I have a website where in the body section of the homepage I need to retrieve:
- News (from news table)
- Top 10 users (from users table)
- 5 latest games (from games table)
- 5 latest videos (from videos table)
- 5 latest slideshow (from slideshow table)
I already have a model for each of these where I can add, update, retrieve, and delete them.
What I want to know is on my Main Controller (which manages the homepage) must I:
- Call each model
- Use the GetUser, GetNews, GetGames, etc. functions to retrieve the data.
- Save each as for example $data['user'], $data['news'], $data['game'] etc.
- Send $data with view?
Or should I create a specific model just for Homepage?
Thanks.[/quote]
I'd take the first approach and call each model for the data I needed from that model.
Why write a new model when you already have code that gets the data your controller needs? Expecially since it'd be largely redundant code...