皎然
public function prevCaptcha($attribute, $params) { $captcha = $this->createCaptchaAction(); $value = $this->vcode; $valid = !is_array($value) && $captcha->validate($value, $this->caseSensitive); if (!$valid) { $this->addError($attribute, ErrorCode::ERROR_VCODE_NOT_MATCH); } } public function createCaptchaAction() { $ca = Yii::$app->createController($this->captchaAction); return $this->captchaAction; if ($ca !== false) { /* @var $controller \yii\base\Controller */ list($controller, $actionID) = $ca; $action = $controller->createAction($actionID); $action->regenerateAfterValidation = false; if ($action !== null) { return $action; } } throw new InvalidConfigException('Invalid CAPTCHA action ID: ' . $this->captchaAction); }
上面是重写的验证方法,总在下面这一步报错,有什么解决办法吗
$ca = Yii::$app->createController($this->captchaAction);
$this->captchaAction = 'api/article/captcha';- 皎然 发表了说说上班卡
- 皎然 2017-09-11 已签到连续签到1天,获得了5个金钱
- 皎然 发表了说说加班卡
- 皎然 2017-09-09 已签到连续签到1天,获得了5个金钱