Alexander Deruwe wrote:
> Hey everyone,
> 
> I'm wondering if it's possible to do conditional validation...  As a  
> bit of explanation, I am working with an object that might have (or  
> have not) some fields set depending on certain conditions.
> Can I handle this with one edit.yml validator?  I.e. have my form  
> like: "form_tag('module/edit?type=blah')" and look at the value of  
> the type parameter in edit.yml and provide fields to be validated  
> accordingly?  Or will I need to have multiple edit actions and  
> validators?
> 
> Thanks for any pointers provided!

You should write one edit.yml with all your possible validators and put
these condition checks into your own validators.

Simply return true in your validator if the field not needs to be
checked. If you need "required checks" on conditional fields you have to
put these checks also in your own validators.

Regards,
Matthias


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to