开发者

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?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜