Public Member Functions | |
| validate (&$errors, $var, $regex, $errorstr, $data=false) | |
| is_valid ($value, $regex) | |
| required (&$errors, $vars, $data=false) | |
| prepare_input ($val) | |
Definition at line 24 of file validator.php.
| Validator::is_valid | ( | $ | value, | |
| $ | regex | |||
| ) |
Shortcut for basic validation - useful for times when you don't need to populate an array of error messages.
| string | $value Value to check for validity | |
| string | $regex Regular expression to use for validation (see top of page.php for default regexps) |
Definition at line 55 of file validator.php.
Referenced by validate().
| Validator::prepare_input | ( | $ | val | ) |
Strip slashes if necessary, depending on magic_quotes_gpc
| mixed | $val |
Definition at line 82 of file validator.php.
Referenced by validate().
| Validator::required | ( | &$ | errors, | |
| $ | vars, | |||
| $ | data = false | |||
| ) |
Validation shortcut to check for required variables
| array | $errors List of errors found during validation | |
| array | $vars Names of request variables to check | |
| array | $data Array of arguments that contains the request variable to validate. If not set, then the default request argument array will be used. |
Definition at line 68 of file validator.php.
References __(), and validate().
| Validator::validate | ( | &$ | errors, | |
| $ | var, | |||
| $ | regex, | |||
| $ | errorstr, | |||
| $ | data = false | |||
| ) |
Basic input validation
| array | $errors List of errors found during validation | |
| string | $var Name of request variable to check | |
| string | $regex Regular expression to use for validation (see top of page.php for defaults regexps) | |
| string | $errorstr Error string to put in $errors if validation check fails | |
| array | $data Array of arguments that contains the request variable to validate. If not set, then the default request argument array will be used. |
Definition at line 36 of file validator.php.
References Registry::get(), is_valid(), and prepare_input().
Referenced by required().
1.6.1