What do you mean with "the validator ignores?" What is the data that you
are trying to validate and what is the result?
On Tuesday, November 11, 2014 5:03:19 PM UTC+1, cesar calvo wrote:
>
> Hi people, I have this validation rules in UsersTable.
> The validator ignores the ->add(password, lenght) sentence.
> The issue is when I try to create or update a record.
>
> Best regards --cesar
>
> public function validationDefault(Validator $validator) {
> return $validator
> ->validatePresence('username', 'create')
> ->notEmpty('username', __('This field is required.'))
> ->add('username', [
> 'valid' => [
> 'rule' => 'email',
> 'message' => __('This field requires a valid email
> address.')
> ],
> 'unique' => [
> 'rule' => 'validateUnique',
> 'provider' => 'table',
> 'message' => __('This field must be unique.')
> ]
> ])
> ->validatePresence('password', 'create')
> ->notEmpty('password', __('This field is required.'))
> ->add('password', [
> 'length' => [
> 'rule' => ['minLength', 8],
> 'message' => __('Password must be at least {0}
> characters long.', 8),
> ]
> ])
> ;
> }
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.