I thought some of you symfony developers out there might appreciate the following form validators. They have been incredibly convenient, and were incredibly simple to write. I hope they come in handy:
- sfValidatorPhone: Validates a phone number using regex
- sfValidatorZip: Validates a zip code using regex
- sfValidatorUrl: Validates a url using regex
- sfValidatorCCExpirationDate (1.2, 1.4): validates the month/year on a credit card. Goes well with sfWidgetFormCCExpirationDate.
- sfValidatorCreditCardNumber: validates a credit card number with an optional card type parameter.
- sfValidatorCoupon: Used in payment forms to validate a coupon
What other useful validators should I include?
***** UPDATE *****
Symfony versions 1.3 and 1.4 broke backwards compatibility with some of these validators. I’ve added a link to each symfony version to fix this.