当前位置: 代码迷 >> .NET Framework >> YII framework CCaptchaAction 解决YII验证码不更新的刷新有关问题
  详细解决方案

YII framework CCaptchaAction 解决YII验证码不更新的刷新有关问题

热度:129   发布时间:2016-05-01 23:39:52.0
YII framework CCaptchaAction 解决YII验证码不更新的刷新问题

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();

}

  相关解决方案