src/Model/Table/UsersTable.php
public function validationPasswordOnly(Validator $validator)
    {
        $validator
            ->notEmpty('password', __d('wasabi_core', 'Please enter a password.'))
            ->add('password', [
                'length' => [
                    'rule' => ['minLength', 6],
                    'message' => __d('wasabi_core', 'Ensure your password consists of at least 6 characters.')
                ]
            ])
            ->notEmpty('password_confirmation', __d('wasabi_core', 'Please repeat your Password.'), function ($context) {
                if ($context['newRecord'] === true) {
                    return true;
                }
                if (isset($context['data']['password']) && !empty($context['data']['password'])) {
                    return true;
                }
                return false;
            })
            ->add('password_confirmation', 'equalsPassword', [
                'rule' => function ($passwordConfirmation, $provider) {
                    if ($passwordConfirmation !== $provider['data']['password']) {
                        return __d('wasabi_core', 'The Password Confirmation does not match the Password field.');
                    }
                    return true;
                }
            ]);

        return $validator;
    }
public function validationPasswordOnly(Validator $validator)
    {
        $validator
            ->notEmpty('password', __d('wasabi_core', 'Please enter a password.'))
            ->add('password', [
                'length' => [
                    'rule' => ['minLength', 6],
                    'message' => __d('wasabi_core', 'Ensure your password consists of at least 6 characters.')
                ]
            ])
            ->notEmpty('password_confirmation', __d('wasabi_core', 'Please repeat your Password.'), function ($context) {
                if ($context['newRecord'] === true) {
                    return true;
                }
                if (isset($context['data']['password']) && !empty($context['data']['password'])) {
                    return true;
                }
                return false;
            })
            ->add('password_confirmation', 'equalsPassword', [
                'rule' => function ($passwordConfirmation, $provider) {
                    if ($passwordConfirmation !== $provider['data']['password']) {
                        return __d('wasabi_core', 'The Password Confirmation does not match the Password field.');
                    }
                    return true;
                }
            ]);

        return $validator;
    }
public function validationPasswordOnly ( Validator $ validator ) { $ validator -> notEmpty ( 'password' , __d ( 'wasabi_core' , 'Please enter a password.' ) ) -> add ( 'password' , [ 'length' => [ 'rule' => [ 'minLength' , 6 ] , 'message' => __d ( 'wasabi_core' , 'Ensure your password consists of at least 6 characters.' ) ] ] ) -> notEmpty ( 'password_confirmation' , __d ( 'wasabi_core' , 'Please repeat your Password.' ) , function ( $ context ) { if ( $ context [ 'newRecord' ] === true ) { return true ; } if ( isset ( $ context [ 'data' ] [ 'password' ] ) && ! empty ( $ context [ 'data' ] [ 'password' ] ) ) { return true ; } return false ; } ) -> add ( 'password_confirmation' , 'equalsPassword' , [ 'rule' => function ( $ passwordConfirmation , $ provider ) { if ( $ passwordConfirmation !== $ provider [ 'data' ] [ 'password' ] ) { return __d ( 'wasabi_core' , 'The Password Confirmation does not match the Password field.' ) ; } return true ; } ] ) ; return $ validator ; }
Only validate password.

@param Validator $validator The validator to customize.
@return Validator
Only validate password .