Validation helper with a shorthand syntax.
use \LSS\Validate;
$data = array('myparam'=>'valid string');
try {
Validate::prime($data);
Validate::go('myparam')->not('blank')->max(20)->is('alnum');
Validate::paint();
} catch(Exception $e){
echo $e;
}
All these types will evaluate to true IF:
Prep validate with an array of data usualy from post()
Starts a validation object for the given param
Returns the current instance
Add error message to buffer This is generally used internally
Sets the var to operate on This is generally used internally
Retrieves the current variable This is generally used internally
Checks that the current var is at minimum $min long
Checks that the current var is at maximum $max long
Checks that the current var is not given $type
Checks that the current var is given #type
If there are any errors in the buffer an exception will be raised Otherwise TRUE is returned
Language | php |
Version | 0.0.0 |
Git URL | https://github.com/nullivex/lib-validate |
License | GPL-3.0 |
Description | Validation helper with a shorthand syntax. |
Keywords |