From 1949a7b0333c54d7c682dcf2f46309ec13cc0f7c Mon Sep 17 00:00:00 2001 From: wangguo Date: Mon, 15 Nov 2021 15:40:18 +0800 Subject: [PATCH] update document --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 474bce0..7fc0e3b 100644 --- a/README.md +++ b/README.md @@ -570,12 +570,23 @@ $v->validate(); ```php ['users.*.id', 'each', 'required', 'isEmpty' => function($value) { - if ($value instanceof \Inhere\Validate\ArrayValueNotExists) { + if ($value instanceof \Inhere\Validate\Exception\ArrayValueNotExists) { return true; } // your code here ... }] ``` +规则包含 .* 时的自定义验证,如: users.*.id +```php +['users.*.id', 'string', 'isEmpty' => function(array $value) { + foreach ($value as $item) { + if ($item instanceof \Inhere\Validate\Exception\ArrayValueNotExists) { + return true; + } + // your code here ... + } +}] +``` ### `filter` -- 使用过滤器