1 controller = 1 model VS. 1 controller = multiple model |
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!
|
Welcome Guest, Not a member yet? Register Sign In |