mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Merge pull request #238 from thinkjson/master
Documentation: numeric array validation example
This commit is contained in:
commit
59f04de714
13
README.md
13
README.md
@ -86,6 +86,19 @@ if($v->validate()) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or use dot syntax to validate all members of a numeric array:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$v = new Valitron\Validator(array('values' => array(50, 90)));
|
||||||
|
$v->rule('max', 'values.*', 100);
|
||||||
|
if($v->validate()) {
|
||||||
|
echo "Yay! We're all good!";
|
||||||
|
} else {
|
||||||
|
// Errors
|
||||||
|
print_r($v->errors());
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Setting language and language dir globally:
|
Setting language and language dir globally:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user