Hi, i have some problem with StrLength validator:
$password = new Password('password', array('required' => true, 'class' => 'span12'));
$password->addValidators(array(
new PresenceOf(array(
'message' => 'password required',
)),
new StringLength(array(
'min' => 8,
'messageMinimum' => 'Password is too short. Minimum 8 characters'
)),
new Confirmation(array(
'message' => 'Password doesn\'t match confirmation',
'with' => 'repassword'
))
));
And i got error:
#0 Phalcon\Mvc\Model\Validator\StringLength->validate(Object(Phalcon\Validation), password)
#1 Phalcon\Validation->validate(Array([id] => (empty string), [csrf] => a7ee72dcd676d63f5937876b2f6485c5, [login] => login, [name] => full name, [email] => [email protected], [role] => member, [password] => pass, [repassword] => pass), null)
#2 Phalcon\Forms\Form->isValid(Array([id] => (empty string), [csrf] => a7ee72dcd676d63f5937876b2f6485c5, [login] => login, [name] => full name, [email] => [email protected], [role] => member, [password] => pass, [repassword] => pass))
Controller:
if($request->isPost()){
if($userForm->isValid($this->request->getPost())){
//....
}
}