作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想一起打印所有验证错误,而不是每个字段旁边的每个错误。
但是 form_errors(form) 不工作。
我可以打印单个错误,所以我想我可以为每个字段使用 form_errors(form.some_field)。问题是它会打印类似“此字段不能为空”的错误,除非紧挨着该字段,否则这是没有意义的。
有什么想法吗?
最佳答案
您应该查看 error_bubbling
字段属性。如果将该属性设置为 true,则该字段的任何错误都将传递给父字段或表单。
例如,如果在普通字段上设置为 true,则该字段的任何错误都将附加到主表单,而不是特定字段。
关于php - Symfony2 表格 : How to display all the errors?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7375744/
我是一名优秀的程序员,十分优秀!