yii\captcha\Captcha::getClientOptions PHP Method

getClientOptions() protected method

Returns the options for the captcha JS widget.
protected getClientOptions ( ) : array
return array the options
    protected function getClientOptions()
    {
        $route = $this->captchaAction;
        if (is_array($route)) {
            $route[CaptchaAction::REFRESH_GET_VAR] = 1;
        } else {
            $route = [$route, CaptchaAction::REFRESH_GET_VAR => 1];
        }
        $options = ['refreshUrl' => Url::toRoute($route), 'hashKey' => 'yiiCaptcha/' . trim($route[0], '/')];
        return $options;
    }