Welcome Guest, Not a member yet? Register   Sign In
best way to add validation functions
#2

[eluser]ontguy[/eluser]
I think extending the validation class is the best way to centralize callbacks:

So I could have a username_duplicate_check callback function included in MY_Validation.php, then use it in the validation rules:
Code:
$rules['username'] = 'trim|required|username_duplicate_check';

I have been giving some thought about where to centralize rules for fields used in multiple controllers; I think a config file maybe the place to do it or maybe even putting it MY_Validation and overriding it if needed.


Messages In This Thread
best way to add validation functions - by El Forum - 06-19-2008, 09:40 AM
best way to add validation functions - by El Forum - 06-19-2008, 10:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB