wenhua
验证码不变需要改框架源码 vender\yiisoft\yii2\captcha\CaptchaAction.php getVerifyCode($regenerate = true)
验证码总是错误 应该是你的 $captchaAction 属性没有设置正确。
model 的rules方法
['captcha', 'captcha', 'message'=>'验证码错误', 'captchaAction'=>'user/captcha'],模板的地方也有个 captchaAction 选项。
<?php echo Captcha::widget(['name'=>'captchaimg','captchaAction'=>'login/captcha','imageOptions'=>['id'=>'captchaimg', 'title'=>'换一个', 'alt'=>'换一个', 'style'=>'cursor:pointer;'],'template'=>'{image}']); ?>谢谢。我的就是captchaAction没设置正确,老是通不过,原来是模版的地方设置了,rules那里没有设置。
- wenhua 发表了说说以找工作为目的,现在学yii2好还是yii1好呢?