我已经自定义了 FOSUserBundle 的注册表单,并将其添加到了我的 BloggerBlogBundle 中,但是当我尝试提交注册表单时,它只是说“请输入密码”...
这是我的注册表格类型
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('fname', null, array('label' => 'first name', 'translation_domain' => 'FOSUserBundle'))
->add('lname', null, array('label' => 'last name', 'translation_domain' => 'FOSUserBundle'))
->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))
->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))
->add('category','choice', array(
'choices' => array(
'sport' =>'sport',
'news' => 'news',
'ecommerce' => 'ecommerce',
)))
->add('password', 'repeated', array(
'type' => 'password',
'options' => array('translation_domain' => 'FOSUserBundle'),
'first_options' => array('label' => 'form.password'),
'second_options' => array('label' => 'form.password_confirmation'),
'invalid_message' => 'fos_user.password.mismatch',
))
;
}