|
|
|
|
|
by bergie
5439 days ago
|
|
That looks pretty much correct: * 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). |
|
Let's say I add a few more things to that controller: namely ability to check if account is disabled(and to disable after x attempts and notify user) or if a captcha needs to be shown or was shown etc.
I feel before you know it the controller can get fairly complicated with all the asserts in real-life scenarios. May be the orig author is ok with it but reading the post I started getting ideas about simple 5-10 line controllers.