从sfGuardUserAdminForm取消设置“password_again”

时间:2012-04-18 15:03:19

标签: forms symfony-1.4 backend

我尝试从后端应用上的sfGuardUserAdminForm取消设置小部件“password_again”。但没有任何作用。

我尝试不在generator.yml文件中显示

form:
    class: sfGuardUserAdminForm
    display:
      "User":                   [first_name, last_name, email_address, username]
      "Permissions and groups": [is_active, is_super_admin, groups_list, permissions_list]

但是场地仍然出现在场地中。 我尝试在表单配置上取消设置     未设置($此[ 'password_again']);

但是出现错误     小部件“password_again”不存在。

1 个答案:

答案 0 :(得分:0)

/plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardUserAdminForm.class.php 评论下一行

//  $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword();
//    $this->validatorSchema['password_again'] = clone $this->validatorSchema['password'];
//
//    $this->widgetSchema->moveField('password_again', 'after', 'password');
//
//    $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.')));

sfGuardUserAdminForm.class.php

unset($this['password_again']); 

并且它来自generator.yml