However, I’m not entirely sure how best to do this. I think that I might go with using:
- <crtx:input type=“text“ validate=“Finance.IBAN“ />
- <crtx:input type=“text“ validate=“CreditCard“ />
- <crtx:input type=“text“ validate=“US.ssn“ />
- <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.