从“尊重/验证”中获取错误属性的名称


Get name of error attributes from Respect/Validation

我正在使用尊重验证库,当我尝试验证我的输入日期时:

v::key('email', v::notEmpty()->Email()->setName('email'))

它返回正确的消息,如:

"email must be valid email"

但我无法检索导致错误发生的属性的名称,我希望它有一些函数,比如getErrorName()或getErrorAttributes,但我找不到。你能帮帮我吗。非常感谢!

请参阅与开发人员就这个问题进行的长达3年的讨论。使用此验证库可能无法执行您的要求。

https://github.com/Respect/Validation/issues/86