如何调试Symfony2表单? [英] How to debug a Symfony2 form?

查看:53
本文介绍了如何调试Symfony2表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个注册页面,以基于FOSU​​serBundle创建一个新用户.

I'm creating a register page to create a new user based on FOSUserBundle.

每次提交新的用户表单时,我都会在表单的顶部显示此消息:此值不能为空.

I go this message on the top f the form every time I submit the new user form: This value should not be blank.

显然这是一条全局消息,并且未链接到表单上的特定字段,因此我想它必须与User类的其他任何属性相关.

Apparently this is a global message and it's not linked to a particular field on my form, so I guess it must be related to any other atribute of my User class.

Sf2提供什么机制来弄清楚我的表格有什么问题?我正在使用Symfony 2.5.0

What mechanism Sf2 offers me in order to figure out what's wrong on my form? I am using Symfony 2.5.0

(我会发布有关我的配置,用户类和表单的更多详细信息,但是我真的很想学习如何自行找到此问题)

(I would post more details about my configuration, User class and form... but I really would like to learn how to find this problem on my own)

提前感谢社区!

推荐答案

查看开发前端控制器上的调试工具栏,这是开始的良好调试方式

Check out debug toolbar on dev frontend controller, its good debug way for the start

这篇关于如何调试Symfony2表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆