1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
$this->setValidator('login', new sfValidatorAnd(
array(
new sfValidatorString(
array(
'required' => FALSE,
'min_length' => 6,
'max_length' => 14),
array(
'min_length' => "Le login est trop court. 6 caractères minimum.",
'max_length' => "Le login est trop long. 14 caractères maximum",
)
),
new sfValidatorRegex(
array('pattern' => '/^[a-zA-Z0-9-]+$/'),
array('invalid' => 'Le login ne peut pas contenir de caractères spéciaux.')
)
),
array(),
array(
'invalid' => "Le login ne peut pas contenir de caractère spéciaux."
)
)
); |
Partager