Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 编辑sfforkeddoctrineaplyplugin用户/设置_Php_Symfony1_Doctrine_Symfony 1.4 - Fatal编程技术网

Php 编辑sfforkeddoctrineaplyplugin用户/设置

Php 编辑sfforkeddoctrineaplyplugin用户/设置,php,symfony1,doctrine,symfony-1.4,Php,Symfony1,Doctrine,Symfony 1.4,我不想编辑sfforkeddoctrineaplyplugin创建的用户/设置页面。 我找不到任何有用的东西。或者有没有办法完全禁用用户/设置,并使用自定义配置文件页面设置新邮件地址的方法 编辑:目前sfforkeddoctrineaplyplugin的用户/设置表单仅允许我修改名字和姓氏。我不想编辑这个,也不想创建(我更喜欢)我自己的自定义用户设置页面,也不想使用sfforkeddoctrineaplyplugin中已经构建的更改电子邮件地址的方法。检查文件:sfApplySettingsFo

我不想编辑sfforkeddoctrineaplyplugin创建的用户/设置页面。 我找不到任何有用的东西。或者有没有办法完全禁用用户/设置,并使用自定义配置文件页面设置新邮件地址的方法


编辑:目前sfforkeddoctrineaplyplugin的用户/设置表单仅允许我修改名字和姓氏。我不想编辑这个,也不想创建(我更喜欢)我自己的自定义用户设置页面,也不想使用sfforkeddoctrineaplyplugin中已经构建的更改电子邮件地址的方法。

检查文件:sfApplySettingsForm.class.php 有:

class sfApplySettingsForm extends sfGuardUserProfileForm
{
  public function configure()
  {
    parent::configure();
    $this->removeFields();

    // We're editing the user who is logged in. It is not appropriate
    // for the user to get to pick somebody else's userid, or change
    // the validate field which is part of how their account is
    // verified by email. Also, users cannot change their email
    // addresses as they are our only verified connection to the user.

    $this->widgetSchema->setLabels(
            array(
                'firstname' => 'First Name',
                'lastname' => 'Last name') );
    $this->widgetSchema->moveField('firstname', sfWidgetFormSchema::FIRST);
    $this->widgetSchema->moveField('lastname', sfWidgetFormSchema::AFTER, 'firstname');

    $this->widgetSchema->setNameFormat('sfApplySettings[%s]');
    $this->widgetSchema->setFormFormatterName('list');

    $this->setValidator( 'firstname' , new sfValidatorApplyFirstname() );
    $this->setValidator( 'lastname', new sfValidatorApplyLastname() );



  }

  protected function removeFields()
  {
    unset(
        $this['user_id'],
        $this['validate'],
        $this['email'],
        $this['email_new'],
        $this['validate_at'],
        $this['id'],
        $this['created_at'],
        $this['updated_at']
    );
  }
}