Welcome Guest, Not a member yet? Register   Sign In
1 controller = 1 model VS. 1 controller = multiple model
#8

(08-27-2018, 01:20 PM)skunkbad Wrote:
(08-27-2018, 09:33 AM)albertleao Wrote: ...

such as a single database table.

...

THIS

Although, you could have a model for a group of related tables, if you choose. I do this for authentication, because the tables are all related, and most don't need their own model.

Personally, I find it a lot easier and more organized to keep my models in a 1 to 1 relationship with database tables, then if I have some functionality I want to reuse that uses multiple models, I create a library. I find it easier to test as well since you can easily inject stubs for models in the library.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply


Messages In This Thread
RE: 1 controller = 1 model VS. 1 controller = multiple model - by albertleao - 08-27-2018, 01:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB