Aller au contenu principal

sfValidatorEmails

public function __construct($options = array(), $messages = array()) { parent::__construct(array_merge($options, array('trim' => true)), $messages); } public function doClean($value) { $i = 0; $emails = explode(" ", $value); $validator = new sfValidatorEmail($this->options, $this->messages); $cleaned_emails = array(); try { foreach ($emails as $email) { ++$i; $cleaned_emails[] = $validator->clean($email); } } catch (Exception $e) { throw new sfValidatorError($this, 'invalid', array('line' => $i, 'bad_email' => $email)); } return implode(" ",$cleaned_emails); } }