收到此错误:小部件“password_again”不存在。
我想不出它为什么突然开始出现。我正在使用 sfDoctrineGuard 插件提供的默认生成器文件
plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/config/generator.yml
generator:
class: sfDoctrineGenerator
param:
model_class: sfGuardUser
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: sf_guard_user
with_doctrine_route: true
config:
fields:
password_again: { label: "Password (again)" }
list:
title: User list
display: [=username, created_at, updated_at, last_login]
form:
class: sfGuardUserAdminForm
display:
"NONE": [username, password, password_again]
"Permissions and groups": [is_active, is_super_admin, groups_list, permissions_list]
edit:
title: Editing User "%%username%%"
new:
title: New User
对字段 password_again 的唯一其他引用在这里:
plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardUserAdminForm.class.php
class BasesfGuardUserAdminForm extends BasesfGuardUserForm
{
/**
* @see sfForm
*/
public function setup()
{
parent::setup();
unset(
$this['last_login'],
$this['created_at'],
$this['updated_at'],
$this['salt'],
$this['algorithm']
);
$this->widgetSchema['groups_list']->setLabel('Groups');
$this->widgetSchema['permissions_list']->setLabel('Permissions');
$this->widgetSchema['password'] = new sfWidgetFormInputPassword();
$this->validatorSchema['password']->setOption('required', false);
$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.')));
}
}
这又没有改变。所以我不太确定接下来要尝试什么才能让它发挥作用。
有任何想法吗?