|
|
|
|
|
by badclient
5439 days ago
|
|
Nice post that would be even nicer if accompanied by some pseudocode examples. You go on and on about constantly reducing the size of your controllers. I'm sold! I just don't know where to start :( Let's say I am verifying login. So I have the controller that looks something like this: Function logincontroller() { if (model->verify(user,pass))
redirect(validurl)
Else
Redirect(invalidurl) } How can I improve this? Btw my intended syntax was php but left out proper syntax due to iPhone:) |
|
* Model handles its own logic (in this case, verification of credentials)
* Controller controls what happens (calling model to verify, redirecting user)
In general, models should only be concerned about their own data, and about their relations to other models. All behavior related to users should be handled by controllers (that call models as needed).