php-validate icon indicating copy to clipboard operation
php-validate copied to clipboard

自定义msg数组形式的无效果

Open juvenrui opened this issue 2 years ago • 0 comments

这不知道是不是bug?

改用translates做了解决。

$v = \Inhere\Validate\Validation::make(data: [
    'title' => '',
    'name' => '',
], rules: array(
    ['title,name', 'required', 'msg' => [
        'tagId' => '标题不能为空。',
        'userId' => '姓名不能为空。',
    ]],
))->validate(
    stopOnError: !true
);
if ($v->isFail()) {
    var_dump($v->getErrors());
};
截屏2022-07-18 17 43 54

juvenrui avatar Jul 18 '22 09:07 juvenrui