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

init() public method

public init ( )
    public function init()
    {
        parent::init();
        if (empty($this->secret)) {
            if (!empty(Yii::$app->get('reCaptcha')->secret)) {
                $this->secret = Yii::$app->reCaptcha->secret;
            } else {
                throw new InvalidConfigException('Required `secret` param isn\'t set.');
            }
        }
        if ($this->message === null) {
            $this->message = Yii::t('yii', 'The verification code is incorrect.');
        }
    }