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