1

I have observed that some validators (Alnum, Alpha, Float, Int and PostCode) are localized into "Zend\I18n\Validator" package instead of "Zend\Validator" how the zend documentation explains.

Somebody knows because it's so.

Can I use these validators without problems?

josepmra
  • 617
  • 9
  • 25

1 Answers1

2

Yes you can use them without problems. You may have to change your "use" statement or you can refer to them using their full namespace. In my current project I'm using the AnnotationBuilder to validate forms that contain floats using the @Annotation\Validator() syntax. It works quite well.

The only issue I came across was I needed to install/enable the php-intl extension on my server.

Mai
  • 21
  • 3
  • Thanks for the php-intl tip; without installing this extension, I was getting errors when trying to use those validators. – ba0708 Nov 24 '12 at 15:50
  • Did you specify {"name":"I18n\Validator\Float"} for your options to @Annotation\Validator()? – four43 Feb 13 '13 at 16:06
  • No, just `@Annotation\Validator({"name":"Float"})` – Mai Feb 20 '13 at 22:54