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

Your controllers SHOULDN'T have a 1:1 relationship with models. They are taking care of different things.

A model should handle an entity, such as a single database table. Your controller calls upon your different models for data.

For example, let's say during registration, you have to create your user and create a profile he belongs to. Your registration controller should call the UserModel & the ProfileModel.

Any business logic relating to users or profiles should be in their models.
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, 09:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB