Cześć,
nie mogę sobie poradzić ze sprawdzeniem, czy podane w formularzu hasła są identyczne. Moja klasa formularza:
<?php
class UserForm extends BaseUserForm {
public function configure() {
'id' => new sfWidgetFormInputHidden(),
'email' => new sfWidgetFormInput(),
'pass' => new sfWidgetFormInputPassword(),
'repass' => new sfWidgetFormInputPassword(),
'name' => new sfWidgetFormInput()
));
$this->widgetSchema->setLabels(array( 'email' => 'Adres e-mail',
'pass' => 'Hasło',
'repass' => 'Powtórz hasło',
'name' => 'Imię'
));
$this->setValidators(array( 'id' => new sfValidatorPropelChoice
(array('model' => 'User', 'column' => 'id', 'required' => false)), 'email' => new sfValidatorEmail(),
'pass' => new sfValidatorString
(array('min_length' => 5)), 'repass' => ?,
'code' => new sfValidatorString
(array('min_length' => 32, 'max_length' => 32
)), ));
$this->validatorSchema['email']->setMessages(array( 'required' => 'Pole e-mail jest wymagane',
'invalid' => 'Podany adres e-mail jest niepoprawny'
));
$this->validatorSchema['pass']->setMessages(array( 'required' => 'Hasło jest wymagane',
'invalid' => 'Podane hasło jest złeee'
));
$this->widgetSchema->setFormFormatterName('list');
$this->widgetSchema->setNameFormat('user[%s]');
}
}
?>
Nie wiem za bardzo jak to ugryźć. Na forum Symfony znalazłem info:
http://www.symfony-project.org/forum/index.php/m/53890/ale coś nie bardzo to chce działać :/
Korzystam z Symfony 1.1.0-RC2
Proszę o pomoc,
pion
Ten post edytował phpion 23.06.2008, 11:08:59