miraclehw 2015-12-19 17:17:45 2888次浏览 0条回复 1 0 0

actions代码:

 public function actions(){
        return [
            'captcha' =>[
                'class' => 'yii\captcha\CaptchaAction',
                'maxLength' => 4,
                'minLength' => 4,
                'width' => 80,
                'height' => 50
            ],
        ];
    }

模型中的代码:

['vcode','captcha','captchaAction' => 'admin/user/captcha','message' => '验证码不正确'],

前端代码:

 <?php echo $form->field($model,'vcode')->widget(Captcha::className(),[
        'captchaAction' => 'user/captcha',
        'imageOptions' => ['title' => '点击更换验证码']
    ])?>

我是放在admin模块中user控制器中。 希望大家帮忙看看!

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册