Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

list validators

  • Loading branch information...
commit 0b94821162c1ab353a54006b0dffc7c266f466a5 1 parent 96fc753
@c9s authored
Showing with 22 additions and 8 deletions.
  1. +22 −8 README.md
View
30 README.md
@@ -1,22 +1,36 @@
# Validation
+
+## Validators
+
+- PhoneNumber/TWPhoneNumberValidator
+- TW/IDNumberValidator.php
+- CallbackValidator
+- ChainedValidator
+- EmailValidator
+- PasswordValidation
+- PatternValidator
+- RangeValidator
+- StringLengthValidator
+- StringValidator
+
## PatternValidator
$validator = new PatternValidator( '#test test test#' );
- $bool = $validator->check( $value );
- $msg = $validator->getMessage();
+ $bool = $validator->validate( $value );
+ $msgs = $validator->getMessages();
## StringValidator
$validator = new StringValidator(array(
- 'start_with' => '....' ,
- 'end_with' => ... ,
+ 'starts_with' => '....' ,
+ 'ends_with' => ... ,
'is' => ...,
'contains' => ...,
'except' => ...,
));
- $bool = $validator->check( $string );
- $msg = $validator->getMessage();
+ $bool = $validator->validate( $string );
+ $msgs = $validator->getMessages();
## RangeValidator
@@ -24,9 +38,9 @@
'greater_than' => 100,
'less_than' => 200,
));
- $bool = $validator->check( 200 );
+ $bool = $validator->validate( 200 );
$validator = new RangeValidator(array( '>' => 10 , '<' => 200 ));
- $bool = $validator->check( 10.0 );
+ $bool = $validator->validate( 10.0 );
Please sign in to comment.
Something went wrong with that request. Please try again.