Wednesday, July 11, 2012

Using Validators in Actions in Symfony

Check whether an email address is valid or not with sfValidatorEmail:
$v = new sfValidatorEmail();
try {
  $v->clean(trim($email));
} catch (sfValidatorError $e) {
  // not valid
}

No comments:

Post a Comment