Configure step-based validation groups
masterBy default, the bundle automatically generates step-based validation groups to validate the form data class bound to the flow.
- Naming Convention: If your flow's
getName()returnscreateVehicle, the first step's group will beflow_createVehicle_step1. - Customization: You can change the prefix by setting the
validationGroupPrefixproperty on your flow class. - Overriding: Setting
validation_groupsin a form type'sconfigureOptionsis ignored because the flow overwrites it. To use custom groups, you must:- Override the flow's
getFormOptionsmethod. - Use the
form_optionskey in the step configuration. - Use the
setGenericFormOptionsmethod.
- Override the flow's
Note: If you set validation_groups to false, a closure, or a GroupSequence, the flow will not automatically append the step number to the group.