src/Model/UserValidationTrait.php
public function validationConfirmPassword(Validator $validator) {
		$validator->setProvider('userBehavior', $this);

		$validator->add($this->_field('passwordCheck'), [
			'notBlank' => [
				'rule' => 'notBlank',
				'message' => __d('user_tools', 'A password is required.')
			],
			'minLength' => [
				'rule' => ['minLength', $this->_config['passwordMinLength']],
				'message' => __d('user_tools', 'The password must have at least 6 characters.')
			],
			'confirmPassword' => [
				'rule' => ['compareFields', 'password'],
				'message' => __d('user_tools', 'The passwords don\'t match!'),
				'provider' => 'userBehavior',
			]
		]);

		return $validator;
	}
public function validationConfirmPassword(Validator $validator) {
		$validator->setProvider('userBehavior', $this);

		$validator->add($this->_field('passwordCheck'), [
			'notBlank' => [
				'rule' => 'notBlank',
				'message' => __d('user_tools', 'A password is required.')
			],
			'minLength' => [
				'rule' => ['minLength', $this->_config['passwordMinLength']],
				'message' => __d('user_tools', 'The password must have at least 6 characters.')
			],
			'confirmPassword' => [
				'rule' => ['compareFields', 'password'],
				'message' => __d('user_tools', 'The passwords don\'t match!'),
				'provider' => 'userBehavior',
			]
		]);

		return $validator;
	}
public function validationConfirmPassword ( Validator $ validator ) { $ validator -> setProvider ( 'userBehavior' , $ this ) ; $ validator -> add ( $ this -> _field ( 'passwordCheck' ) , [ 'notBlank' => [ 'rule' => 'notBlank' , 'message' => __d ( 'user_tools' , 'A password is required.' ) ] , 'minLength' => [ 'rule' => [ 'minLength' , $ this -> _config [ 'passwordMinLength' ] ] , 'message' => __d ( 'user_tools' , 'The password must have at least 6 characters.' ) ] , 'confirmPassword' => [ 'rule' => [ 'compareFields' , 'password' ] , 'message' => __d ( 'user_tools' , 'The passwords don\'t match!' ) , 'provider' => 'userBehavior' , ] ] ) ; return $ validator ; }
Validates the confirm_password field.

Override it as needed to change the rules for only that field.

@param \Cake\Validation\Validator $validator Validator
@return \Cake\Validation\Validator
Validates the confirm_password field .