In the documentation it lists examples for applying a class validation constraint to Annotations, XML and YAML but not for PHP.
Since the validation is not applied to a property, where do I add this class validation constraint to the whole class inside a Symfony form type?
I think I've found a solution here: https://knpuniversity.com/screencast/question-answer-day/custom-validation-property-path There is a tip what says:
If your form lives in a form type class, simply add the constraints key to the setDefaulOptions method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With