i have an modal with an form, when i send the form and it is invalid then the modal closes and you can only see the error when you reopen the modal.
My Solution so far is in my controller an elseif($form->isSubmitted() && !$form->isValid()) an then display an flash an Error Message "something went wrong"
But i think it would be the best when:
The modal would not be closed (but i think it is not working, only with javascript but i dont like it that way :-( )
I can display the error in my flash-message, i tried $form->getErrors() and $form['name']->getErrors() but if i var_dump() it i get a ton of arrays and things but not the right Error message... something like "name already exists" ?
Is there a right way to get the "contraints" Error Message ?