Hey there,

ah, ok. In that case I think throwing custom exceptions that extend
the sfValidatorError would be in order.
Just catch those in the actions, and depending on their type you'll
know which error occurred.

I'm doing something similar where in my setup the credit card
validator can throw a more powerful exception in case it can't connect
to the server, or something major breaks down.
That way the action gets to show a different template.

Daniel


On Apr 12, 3:59 pm, WallTearer <walltea...@gmail.com> wrote:
> Thanks a lot, Daniel,
> but in my case I have to trigger different functions depending on the
> results of validation.
> Lets say I have 2 fields: field_1 and field_2.
> If field_1 passed validation and field_2 didn't - action needs to
> trigger function a() and show default template.
> If field_2 didn't pass validation but field_2 passed - action needs to
> trigger function b() and then show different template.
> So this can not be implemented just in the form((
> I still need to get info about which exactly errors happened to which
> fields.
> Maybe I can check this by $form['field_1']->hasError(), but I still
> need to get error code or error description.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to