Skip to content

Commit d2397ed

Browse files
authored
Merge pull request #50 from boobusy/doc
2 parents c72b7b3 + 1949a7b commit d2397ed

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,23 @@ $v->validate();
570570

571571
```php
572572
['users.*.id', 'each', 'required', 'isEmpty' => function($value) {
573-
if ($value instanceof \Inhere\Validate\ArrayValueNotExists) {
573+
if ($value instanceof \Inhere\Validate\Exception\ArrayValueNotExists) {
574574
return true;
575575
}
576576
// your code here ...
577577
}]
578578
```
579+
规则包含 .* 时的自定义验证,如: users.*.id
580+
```php
581+
['users.*.id', 'string', 'isEmpty' => function(array $value) {
582+
foreach ($value as $item) {
583+
if ($item instanceof \Inhere\Validate\Exception\ArrayValueNotExists) {
584+
return true;
585+
}
586+
// your code here ...
587+
}
588+
}]
589+
```
579590

580591
### `filter` -- 使用过滤器
581592

0 commit comments

Comments
 (0)