How to validate a field that depends on another to be mandatory in Symfony?

Asked

Viewed 36 times

0

In Laravel there is a validation required_if, I say that a field will be mandatory only if another field is informed. I need to do the same type of validation using the FormType from Symfony but I couldn’t find anything in the documentation that works like this. I can validate this in Controller but I wanted to leave that responsibility to my FormType since all other validations are on it.

Someone has done something similar at Symfony that can help me?

Version of Symfony: 3.4

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.