Welcome Guest, Not a member yet? Register   Sign In
extending validation
#1

[eluser]dimis[/eluser]
I extended validation library and I make a function
Code:
function unique_email($str, $field,$user)
    {
}
I call that
Code:
$rules['email'] = "required||valid_email|unique_email[users.user_email,$username]";
but there is the error
Code:
Missing argument 3 for MY_Validation::unique_email()
How can I call this function?
#2

[eluser]JoostV[/eluser]
a validation callback function takes only one argument by default and returns true or false. So in your case:
Code:
function unique_email($str) {
    // Return true if $str validates
    // Retrun false if it doesn't
}
$str is the $_POST value for this field




Theme © iAndrew 2016 - Forum software by © MyBB