yii\validators\BooleanValidator::clientValidateAttribute PHP Method

clientValidateAttribute() public method

public clientValidateAttribute ( $model, $attribute, $view )
    public function clientValidateAttribute($model, $attribute, $view)
    {
        $options = ['trueValue' => $this->trueValue, 'falseValue' => $this->falseValue, 'message' => Yii::$app->getI18n()->format($this->message, ['attribute' => $model->getAttributeLabel($attribute), 'true' => $this->trueValue === true ? 'true' : $this->trueValue, 'false' => $this->falseValue === false ? 'false' : $this->falseValue], Yii::$app->language)];
        if ($this->skipOnEmpty) {
            $options['skipOnEmpty'] = 1;
        }
        if ($this->strict) {
            $options['strict'] = 1;
        }
        ValidationAsset::register($view);
        return 'yii.validation.boolean(value, messages, ' . json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ');';
    }