setWidgets(array( 'key' => new sfWidgetFormInputHidden(), 'user_fk' => new sfWidgetFormInputHidden(), 'username' => new sfWidgetFormInputHidden(), 'password' => new sfWidgetFormInputPassword(), 'password2' => new sfWidgetFormInputPassword(), )); $this->widgetSchema->setLabels(array( 'password' => 'New password', 'password2' => 'Retype password', )); $this->setValidators(array( 'key' => new sfValidatorString(array('required'=>true,'min_length'=>5)), 'user_fk' => new sfValidatorString(array('required'=>true)), 'username' => new sfValidatorString(array('required'=>true)), 'password' => new sfValidatorString(array('required'=>true)), 'password2' => new sfValidatorString(array('required'=>true)), )); $this->validatorSchema->setPostValidator( new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password2', array(), array('invalid' => 'Passwords don\'t match. ') )); $this->widgetSchema->setNameFormat('resetpassword[%s]'); } } ?>