ozziest / windrider
Usefull form validation library
3.0.0
2017-10-11 17:56 UTC
Requires (Dev)
- phpunit/phpunit: 4.8.*
This package is not auto-updated.
Last update: 2024-12-21 19:31:56 UTC
README
Windrider is a simple and useful validation library which you can use it on your projects.
Installation
$ composer require ozziest/windrider
#### Usage
try { $data = ['name' => '']; $rules = [ ['name', 'Name', 'required'], ['email', 'E-Mail', 'required|valid_email'] ]; Ozziest\Windrider\Windrider::runOrFail($data, $rules); } catch (Exception $exception) { var_dump(Ozziest\Windrider\Windrider::getErrors()); }
Methods
run($data, $rules)
runOrFail($data, $rules)
getErrors()
setErrors($messages)
#### Validations
- required
- valid_email
- min_length[n]
- max_length[n]
- exact_length[n]
- alpha
- alpha_numeric
- alpha_dash
- alpha_local (Turkish characters support)
- sentence (Turkish characters support)
- numeric
- integer
- is_natural
- is_natural_no_zero
- less_than[n]
- greater_than[n]