itvisionsy/validator

A validator that works.

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Language:JavaScript

dev-master 2015-02-11 04:21 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:59:01 UTC


README

A validator that works

Why?

Breifly, a PHP validator that is:

  1. Standalone
  2. Works independenltly for data, as well as files.
  3. Flexible.

How it works?

Simple value simple check

if($errors = ItvisionSy\Validator\RequiredValidatorRule::quick('99')===true){
  // validator succeeded
} else {
  // failed
  var_dump($errors);
}

Simple valude multiple checks

if($errors = ItvisionSy\Validator\ValidatorItem::quick(99,'required')===true){
  // succeeded
} else {
  // failed
  var_dump($errors);
}

Data validation

if($errors = ItvisionSy\Validator\Validator::quick([
  'name'=>'required|string|min:4',
  'email'=>'required|email'
],[
  'name'=>'Muhannad Shelleh'
])===true){
  // succeeded
} else {
  // failed (like now)
  var_dump($errors);
}