How to Require One Symfony Form Field and/or Another

Say there's a Symfony form that requires either one field to be submitted or another field. In this case, it's okay if both are submitted, but at least one is required. I had this exact situation come up earlier this week and all the solutions I found were related to adding validation to models. I… Continue reading How to Require One Symfony Form Field and/or Another

Improving Symfony ChoiceType Error Messages

Symfony Choice Type Error Messages

The Symfony ChoiceType is a complex, interesting beast. By far my biggest complaint about it is the error messages shown to the user during validation are not great. Defaulting to, "This value is not valid," with no help for the user on what values are actually allowed. That's okay for plain HTML interfaces where the… Continue reading Improving Symfony ChoiceType Error Messages