public function configure() { parent::configure(); $this->widgetSchema->setDefault('remember', 'checked'); $this->widgetSchema->setLabels(array('password' => 'Пароль:', 'username' => 'Логин:', 'remember' => 'Запомнить меня')); $this->setValidators(array('username' => new sfValidatorString(array(), array('required' => 'Необходимо ввести логин!')), 'password' => new sfValidatorString(array(), array('required' => 'Необходимо ввести пароль!')), 'remember' => new sfValidatorBoolean())); $this->widgetSchema->setFormFormatterName('list'); $this->validatorSchema->setPostValidator(new sfGuardValidatorUser()); }
public function bind(array $taintedValues = null, array $taintedFiles = null) { $dbError = false; try { parent::bind($taintedValues, $taintedFiles); } catch (sfDatabaseException $e) { $dbError = true; } catch (Doctrine_Connection_Exception $de) { $dbError = true; } if ($dbError) { $this->values = array(); $dummyVal = new sfValidatorPass(array(), array('invalid' => "Can't connect to database")); $ve = new sfValidatorError($dummyVal, 'invalid'); $this->errorSchema = new sfValidatorErrorSchema($dummyVal, array($ve)); } }
public function configure() { parent::configure(); $this->validatorSchema->setPostValidator(new ValidatorUser()); $this->widgetSchema->setFormFormatterName('custom'); }
public function configure() { parent::configure(); $this->validatorSchema->setPostValidator(new ValidatorUser()); }
/** * @see sfForm */ public function configure() { parent::configure(); $this->useFields(array('username', 'password')); }
public function configure() { parent::configure(); }