![]() |
Is it standard practice 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: Is it standard practice to do this (/showthread.php?tid=47824) |
Is it standard practice to do this - El Forum - 12-23-2011 [eluser]Unknown[/eluser] So two questions. First of all here is my code ... (it's missing error checking atm). Code: class Covers extends CI_Controller { The first question is about the the way that I'm adding tags to each cover/article. I'm looping through each cover/article, then doing another database request to get the tags for that cover/article and appending it to a new array. Is it ok to do that or should that be done in the model? The second question is single() method. I feel as if I should be creating a separate controller for returning single covers as the current class is plural and that method only returns a single result. Should I create a separate model and control for returning single covers/articles? I have routing that routes: covers/single/slug.html => slug.html and covers/category/slug => category/slug I'm new to using a framework and would rather learn the correct practices and coding conventions. Thanks |