On Sunday, September 30, 2007, Fabien POTENCIER wrote:
> 1 - The validator throws a sfValidatorException:
>
> throw new sfValidatorException('String is too long');
I like the first method myself.
If you wanted to add more error messages, couldn't you also do:
$e = new sfValidatorException('String is too long');
$e->addError('Stars are not aligned.');
throw $e;
then...
try { ... }
catch (sfValidatorException $e)
{
$errors = $e->getErrors(); // returns array of all errors.
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---