public function clientValidateAttribute($model, $attribute, $view)
{
$captcha = $this->createCaptchaAction();
$code = $captcha->getVerifyCode(false);
$hash = $captcha->generateValidationHash($this->caseSensitive ? $code : strtolower($code));
$options = ['hash' => $hash, 'hashKey' => 'yiiCaptcha/' . $captcha->getUniqueId(), 'caseSensitive' => $this->caseSensitive, 'message' => Yii::$app->getI18n()->format($this->message, ['attribute' => $model->getAttributeLabel($attribute)], Yii::$app->language)];
if ($this->skipOnEmpty) {
$options['skipOnEmpty'] = 1;
}
ValidationAsset::register($view);
return 'yii.validation.captcha(value, messages, ' . json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ');';
}