craue / CraueFormFlowBundle

Multi-step forms for your Symfony project.
MIT License
736 stars 118 forks source link

Manually add FormErrors #382

Open mcgoode opened 3 years ago

mcgoode commented 3 years ago

In the controller how can you manually add errors to inputs?

I need to programmatically and an error to the form and stop it from continuing to the next step. Without the flow I know I can just do something like:

$form->get('name')->addError(new FormError('You have an error here!'));
if( $form->isSubmitted() && $form->isValid())

however there doesn't seem to be a way to do this with the flow.