Welcome Guest, Not a member yet? Register   Sign In
Question about the MVC pattern
#1

[eluser]loathsome[/eluser]
Hi CI people,

I have a question, regarding the mvc pattern. Is it "right" to OUTPUT content (store it in array) from a database from a model? Or should this be done first through a controller?

E. g, views/main.php have:
Code:
foreach($this->db_model->fetch() as $out):

I'm thinking it really should be done this way instead:
views/main.php have
Code:
foreach($fetch_content as $out):

And in controllers/main.php it fetches the content and passes it on
Code:
$data['fetch_content'] = $this->db_model->fetch();
$this->load->view('main', $data);

Which method is the most "right" one?

I appreciate your input, guys!


Messages In This Thread
Question about the MVC pattern - by El Forum - 07-11-2008, 11:05 AM
Question about the MVC pattern - by El Forum - 07-11-2008, 04:33 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 08:05 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 08:28 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 09:40 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 09:41 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 10:24 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 10:42 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 10:58 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 10:59 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 11:02 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 11:05 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 11:17 PM
Question about the MVC pattern - by El Forum - 07-11-2008, 11:22 PM
Question about the MVC pattern - by El Forum - 07-12-2008, 12:40 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 02:17 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 07:13 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 08:43 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 09:09 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 09:30 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 09:39 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 09:48 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 10:29 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 11:04 AM
Question about the MVC pattern - by El Forum - 07-12-2008, 01:07 PM
Question about the MVC pattern - by El Forum - 07-12-2008, 06:51 PM
Question about the MVC pattern - by El Forum - 07-12-2008, 08:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB