Crtx_Form Default Validators

One of the things I want to do for Crtx_Form is to use the PEAR::Validate package for validate.

However, I’m not entirely sure how best to do this. I think that I might go with using:

  1.  
  2.  <crtx:input type=text validate=Finance.IBAN />
  3.  
  4.  <crtx:input type=text validate=CreditCard />
  5.  
  6.  <crtx:input type=text validate=US.ssn />
  7.  
  8.  <crtx:input type=text validate=email />

Basically using . notation for Validate sub-classes. So if the function is in the core Validate class, like email then you don’t use anything but the function name (which refers to Validate::email(), if its in a subclass, like the IBAN function, then you use Finance.iban (case-insensitive), which refers to Validate_Finance::iban().

I haven’t quite worked out how to do multiple validation, though things like required, min/max-length will be attributes for the element.

Any thoughts? I might just make it so you need to specify the full name of a function/class, so it would be “Validate.email” or my_perform_multiple_validation.

– Davey