CodeIgniter Forums
What is the right way use a Controller or Model to do this - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: What is the right way use a Controller or Model to do this (/showthread.php?tid=35778)



What is the right way use a Controller or Model to do this - El Forum - 11-10-2010

[eluser]Unknown[/eluser]
Good night guys,
I am developing a application and I decide to use CodeIgniter, but I have a doubt.

What is the right way, to do the "select" (list registers of table) method in the Controller or use a method in the Model to do the "select"?

Thanks.


What is the right way use a Controller or Model to do this - El Forum - 11-10-2010

[eluser]WanWizard[/eluser]
CodeIgniter follows the MVC design pattern, where the controller determines the flow from request to the output, and all processing happens in the model. So that's where you should do your database queries as well...