vakata / validation
A validation class
Installs: 3 551
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: 4.*
README
An extended implementation of the routing class, dealing with an HTTP abstraction and middleware.
Install
Via Composer
$ composer require vakata/validation
Usage
$v = new \vakata\validation\Validator(); $v ->required('name', 'requiredN')->alpha(null, "alphaN")->notEmpty("empty") ->required('family', 'requiredF')->alpha(null, "alphaF") ->required('age', 'requiredA')->numeric("numericA") ->optional("newsletter")->numeric("numericN") ->optional("children.*.name")->alpha(null, "alphaC") ->optional("children.*.age")->numeric(null, "numericC"); $errors = $v->run($_POST); // inspect the array - if empty - the data is valid
Read more in the API docs
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.