0

我试图从后端应用程序的 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]

但该字段仍然出现在表单中。我尝试在表单上取消设置 configure unset($this['password_again']);

但出现错误 Widget "password_again" 不存在。

4

1 回答 1

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 中删除它

于 2012-04-19T08:08:22.423 回答