$error = sfStringValidator::TOO_LARGE | sfStringValidator::NOT_VALID;
throw new sfValidatorException($error);
Lukas Kahwe Smith wrote:
> Fabien POTENCIER wrote:
>> Why do you want error codes? Do you want something like this?
>
> So that I can handle them more intelligently in my code. For example in
> one case of validation rule violation I might dismiss the request as a
> hack attempt. In another I might trigger some smart algo to
> automatically suggest to the user what he might have meant to input. At
> any rate, error strings are just wrong (tm) for I18N etc. It forces too
> many things upon you (like using a gettext style translation system
> etc). More importantly its a needless limitation and I will most likely
> never want to display the messages generated by symfony validator
> directly to the user.
>
>> throw new sfValidatorException('string_too_large');
>
> or sfValidator::STRING_TOO_LARGE
>
> regards,
> Lukas
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---