Ejemplo n.º 1
0
 public function init()
 {
     $this->addWidget('first_name', new sfWidgetFormInputText(), new sfValidatorString(array("required" => true), array("required" => "Please enter your first name.")));
     $this->addWidget('last_name', new sfWidgetFormInputText(), new sfValidatorString(array("required" => true), array("required" => "Please enter your last name.")));
     $this->addWidget('phone', new sfWidgetFormInputText(), FormUtils::getPhoneValidator());
     $this->addWidget('email', new sfWidgetFormInputText(), FormUtils::getEmailValidator());
     $passwordValidator = new sfValidatorString(array("required" => true, 'min_length' => 6), array('min_length' => "Your password must be at least 6 characters.", "required" => "Please enter a password."));
     $this->addWidget('password', new sfWidgetFormInputPassword(), $passwordValidator);
 }