Skip to content
Advertisement

Tag: symfony-2.0

Symfony2 Validating an optional field

In my form, I have a field with required option set to false, this field is optional. However, I would like to have a notBlank validation on this field when the field is used: Right now, I can’t use the validation constraint NotBlank because it will cause my form validation to fail when the field is unused. I tried something

Advertisement