游学 2014-08-18 10:45:26 6995次浏览 1条评论 2 0 0

YII的验证码想要动态刷新,可以参考下

public function actionTestCaptcha()
{
    $captcha= new CCaptchaAction($this,'captcha');
    Yii::app()->session['captcha'] = $captcha->fixedVerifyCode = substr(md5(time()), 11, 4);
    $captcha->transparent = true;
    $captcha->maxLength = 4;
    $captcha->minLength = 4;
    $captcha->height = 35;
    $captcha->width = 80;
    $captcha->run();

}
您需要登录后才可以评论。登录 | 立即注册