Welcome Guest, Not a member yet? Register   Sign In
best practices on Form Reuse - keeping all forms in a central location with validation
#7

[eluser]Colin Williams[/eluser]
Quote:Validation shouldn't be in the view but it shouldn't be in the controller either. Validation in the controller makes it unmaintainable pretty fast. Validation is best handled in a separate file but to do that you need to customize the Codeigniter.php file.

Customize the CodeIgniter.php file?... I keep my rules, fields, error messages, and default values in a forms.php config file, but I actually do the Validation running and checking in the appropriate Controller methods.


Messages In This Thread
best practices on Form Reuse - keeping all forms in a central location with validation - by El Forum - 07-15-2008, 12:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB