皎然

皎然

PHP,PhpStorm,Yii,Linux

  • 财富值17190
  • 威望值10
  • 总积分17880

个人信息

  • 2017-09-16 已签到
    连续签到6天,获得了20个金钱
  • 发表了说说
    验证码问题终于搞定了,发个红包
  • 2017-09-15 已签到
    连续签到5天,获得了20个金钱
  • 发表了说说
    我真是路痴
  • 2017-09-14 已签到
    连续签到4天,获得了20个金钱
  • 发表了说说
    加班吃炸酱品,打卡
  • 2017-09-13 已签到
    连续签到3天,获得了15个金钱
  • 回复了 的回复
    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';

    在$ca = Yii::$app->createController($this->captchaAction);创建控制器的时候总返回false

  • 2017-09-12 已签到
    连续签到2天,获得了10个金钱
  • 赞了回复
    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';

17880/20000
资料完整度
90/100
用户活跃度
0/100

Ta的关注

6

Ta的粉丝

11

Ta的访客

118