Welcome Guest, Not a member yet? Register   Sign In
Benefits from validating in the controller?
#4

[eluser]Edemilson Lima[/eluser]
If you pass the input data to your model, you can do that there too, if you need to load your model and authenticate the user in many places of your web site. For example, you can show buttons or links to do things in your web site, but if the user is not authenticated yet, you check this, authenticate him/her and then redirect to the original controller associated with the action he/she asked to do.

In some cases you need to do at the controller, but whenever it is possible to do the things at your model, do it there. You may reduce code.


Messages In This Thread
Benefits from validating in the controller? - by El Forum - 01-23-2008, 12:21 PM
Benefits from validating in the controller? - by El Forum - 01-23-2008, 02:13 PM
Benefits from validating in the controller? - by El Forum - 01-23-2008, 02:55 PM
Benefits from validating in the controller? - by El Forum - 01-23-2008, 03:46 PM
Benefits from validating in the controller? - by El Forum - 01-23-2008, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB