Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple ValidationKit for PHP
C PHP
tree: 7852f01478

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/ValidationKit
tests
LICENSE
README.md
build.xml
package.ini
package.xml
phpdox.xml
phpunit-ci.xml
phpunit.xml

README.md

Validation

Validators

  • ValidationKit\PhoneNumber\TWPhoneNumberValidator
  • ValidationKit\TW\IDNumberValidator
  • ValidationKit\CallbackValidator
  • ValidationKit\ChainedValidator
  • ValidationKit\EmailValidator
  • ValidationKit\PasswordValidation
  • ValidationKit\PatternValidator
  • ValidationKit\RangeValidator
  • ValidationKit\StringLengthValidator
  • ValidationKit\StringValidator

PatternValidator

$validator = new PatternValidator( '#test test test#' );
$bool = $validator->validate( $value );
$msgs = $validator->getMessages();

StringValidator

$validator = new StringValidator(array( 
        'starts_with' => '....' , 
        'ends_with' => ... ,
        'is' => ...,
        'contains' => ...,
        'except' => ...,
    ));
$bool = $validator->validate( $string );
$msgs  = $validator->getMessages();

RangeValidator

$validator = new RangeValidator(array(
    'greater_than' => 100,
    'less_than' => 200,
));
$bool = $validator->validate( 200 );

$validator = new RangeValidator(array( '>' => 10 , '<' => 200 ));
$bool = $validator->validate( 10.0 );
Something went wrong with that request. Please try again.