https://github.com/roaatech/validator
A validator that works
https://github.com/roaatech/validator
Last synced: 15 days ago
JSON representation
A validator that works
- Host: GitHub
- URL: https://github.com/roaatech/validator
- Owner: roaatech
- License: mit
- Created: 2015-02-07T18:09:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-11T04:21:58.000Z (over 11 years ago)
- Last Synced: 2024-04-05T04:00:30.455Z (about 2 years ago)
- Language: JavaScript
- Size: 1.3 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# validator
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
```php
if($errors = ItvisionSy\Validator\RequiredValidatorRule::quick('99')===true){
// validator succeeded
} else {
// failed
var_dump($errors);
}
```
### Simple valude multiple checks
```php
if($errors = ItvisionSy\Validator\ValidatorItem::quick(99,'required')===true){
// succeeded
} else {
// failed
var_dump($errors);
}
```
### Data validation
```php
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);
}
```