2

I'm using Respect validation library and when I try to validate my input date:

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

It returns the right message like:

"email must be valid email"

But I cannot retrieve name of the attribute which makes the error happen, I hope it has some function like getErrorName() or getErrorAttributes but I cannot find it out. Could you please help me. Thank you so much!

Mika Tuupola
  • 19,877
  • 5
  • 42
  • 49
Einsamer
  • 1,069
  • 4
  • 17
  • 34

1 Answers1

0

Please refer to this lengthy discussion with the developers for 3 years regarding this very issue. It may not be possible to do what you ask using this validation library.

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

NickNo
  • 872
  • 15
  • 32
  • Is there any difference if I don't use OOP? As I see, you change the messages, but I just want to receive the name of the attributes like "username" or "email" or "password" which causes the error. – Einsamer Jul 25 '16 at 04:31
  • I haven't seen this issue resolved, i changed my answer. – NickNo Jul 25 '16 at 05:20