Symfony: any way to show the global errors only if there isn't any field error?
in a form if there is a field and a global error both messages are showed.
I would like to show the global errors only if th开发者_StackOverflow社区ere isn't any field error.
Any idea?
Javi
This snippet should do the job
<?php if (0 == ( count($form->getErrorSchema()->getErrors()) - count($form->getErrorSchema()->getGlobalErrors()) ) ):?>
<?php echo $form->renderGlobalErrors()?>
<?php endif?>
精彩评论