Validator Class Reference

List of all members.

Public Member Functions

 validate (&$errors, $var, $regex, $errorstr, $data=false)
 is_valid ($value, $regex)
 required (&$errors, $vars, $data=false)
 prepare_input ($val)

Detailed Description

Definition at line 24 of file validator.php.


Member Function Documentation

Validator::is_valid ( value,
regex 
)

Shortcut for basic validation - useful for times when you don't need to populate an array of error messages.

Parameters:
string $value Value to check for validity
string $regex Regular expression to use for validation (see top of page.php for default regexps)
Returns:
boolean

Definition at line 55 of file validator.php.

Referenced by validate().

Validator::prepare_input ( val  ) 

Strip slashes if necessary, depending on magic_quotes_gpc

Parameters:
mixed $val
Returns:
mixed

Definition at line 82 of file validator.php.

Referenced by validate().

Validator::required ( &$  errors,
vars,
data = false 
)

Validation shortcut to check for required variables

Parameters:
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

Parameters:
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().


The documentation for this class was generated from the following file:

Generated on Wed Jan 13 09:21:05 2010 for Pronto Framework by  doxygen 1.6.1