pclib
3.0.0
Lightweight PHP framework
|
Validator with common validation rules. More...
Public Member Functions | |
maxFileSize ($file, $size) | |
Rule handler: Max file size. | |
matchFileType ($file, $pattern) | |
Rule handler: Check file type. | |
matchPattern ($value, $pattern) | |
Rule handler: Match regexp pattern. | |
isEmail ($value) | |
Rule handler: Email address. | |
isUrl ($value) | |
Rule handler: URL starting http://. | |
isIdentifier ($value) | |
Rule handler: Match php identifier. | |
minLength ($value, $length) | |
Rule handler: Minimum number of characters. | |
matchShell ($value, $wildcards) | |
Rule handler: Match wildcards. | |
isNumeric ($value) | |
Rule handler: Match number or numeric string. | |
isNumericInt ($value) | |
Rule handler: Match integer. | |
inRange ($value, $range) | |
Rule handler: Check if value is in range [min, max]. | |
isDateTime ($value, $format='') | |
Rule handler: Match datetime against format $format. | |
isTime ($value) | |
Rule handler: Match time in format HH:MM:SS. | |
Public Member Functions inherited from ValidatorBase | |
setRule ($name, $function, $message) | |
Set or add new rule. More... | |
hasRule ($rule) | |
Check if validator has handler for rule $rule. More... | |
setError ($id, $messageId, array $args=array()) | |
Set error message for element $id. More... | |
getErrors () | |
Return validation errors. | |
isBlank ($value) | |
Check if field is blank (not filled). | |
notBlank ($value) | |
NOT isBlank(). | |
validate ($value, $rules) | |
Validate $value against $rules. More... | |
validateElement ($value, array $elem) | |
Validate $value against $elem rules. More... | |
validateArray (array $values, array $elements) | |
Validate array of values, using validation rules in $elements. More... | |
Public Member Functions inherited from BaseObject | |
loadDefaults ($className=null) | |
Load default parameters of class $className into object instance. | |
setProperties (array $defaults) | |
Set public properties of object from the array. More... | |
toArray () | |
Convert object to array. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseObject | |
static | defaults () |
Set or retireve default parameters of the object. More... | |
Data Fields inherited from ValidatorBase | |
$skipUndefined = false | |
Are variables undefined in template valid? | |
$skipUndefinedRule = false | |
Silently skip unknown rules? | |
$ignoredAttributes = array('id', 'type', 'begin', 'end') | |
List of ignored attributes (rules) | |
$ignoredElements = array() | |
List of ignored element types. | |
$messages | |
Array of messages [ruleName: message, ...]. | |
$translator | |
var Translator | |
Data Fields inherited from BaseObject | |
$serviceLocator | |
var function() Return service object when requested with service(). | |
Protected Member Functions inherited from ValidatorBase | |
validateRule ($value, $rule, $param=null) | |
Validate $value using $rule. More... | |
Protected Member Functions inherited from BaseObject | |
service ($service, $default=null) | |
Try acquire $service and load it into property $this->$service. More... | |
Protected Attributes inherited from ValidatorBase | |
$rules = array() | |
Array of rule handlers [ruleName: callable, ...]. | |
$errors = array() | |
Array of [fieldName: errorMessage, ...]. | |
$parser | |
var TplParser | |
Validator with common validation rules.