himiklab\yii2\recaptcha\ReCaptchaValidator::clientValidateAttribute PHP Method

clientValidateAttribute() public method

public clientValidateAttribute ( Model $model, string $attribute, View $view ) : string
$model yii\base\Model
$attribute string
$view yii\web\View
return string
    public function clientValidateAttribute($model, $attribute, $view)
    {
        $message = $this->uncheckedMessage ? $this->uncheckedMessage : Yii::t('yii', '{attribute} cannot be blank.', ['attribute' => $model->getAttributeLabel($attribute)]);
        return "(function(messages){if(!grecaptcha.getResponse()){messages.push('{$message}');}})(messages);";
    }