![]() |
A layer between controllers and models - 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: A layer between controllers and models (/showthread.php?tid=55382) |
A layer between controllers and models - El Forum - 10-24-2012 [eluser]go4sachin007[/eluser] Hi, I am building a site cum software using codeignier. In this i want to have a layer between controllers and models like services. So that i can use PHPUnit and other APIs in it. Basically the purpose of this layer is that not direct communication between controllers and models. Controllers communicates with service layer and service layer communicate with database(models). Can this scenario be implemented via codeigniter as i need it for my project. I know the flexibility of codeigniter framework. It is a wonderful framework and i have developed my websites with the help of this great framework. So i am expecting a good feedback from you guys. Thank you in advance. go4sachin007 A layer between controllers and models - El Forum - 10-24-2012 [eluser]wiredesignz[/eluser] The model already is the service layer between the application controller and the database. A layer between controllers and models - El Forum - 10-24-2012 [eluser]go4sachin007[/eluser] Still is there a way to introduce a layer? Thanks A layer between controllers and models - El Forum - 10-24-2012 [eluser]wiredesignz[/eluser] The model is the layer. A layer between controllers and models - El Forum - 10-30-2012 [eluser]go4sachin007[/eluser] I am talking the things as is explained in http://www.cmjackson.net/2010/01/18/mvc-and-n-layer-architecture/ can we do that in codeigniter Thanks in advance. A layer between controllers and models - El Forum - 10-30-2012 [eluser]jmadsen[/eluser] CodeIgniter is php If you can do it in php, you can do it in CodeIgniter. I often will use libraries in a way similar to what he seems to be describing in the article. Controllers call a library with the business logic & multiple model function calls inside a "wrapper" function |