yii2.0验证码总是报错 [ 新手入门 ]
模型
public function rules()
{
return [
[['user_name','user_pwd','user_repwd','user_email'],'required','message'=>'不能为空'],
['user_repwd','compare','compareAttribute'=>'user_pwd','message'=>'两次密码不一致'],
['user_email','email','message'=>'邮箱格式不正确'],
['add_time','default','value'=>\time()],
['verifycode','captcha','captchaAction' => 'user/captcha','message'=>'重新输入验证码'],
];
}
echo $form->field($model,'verifycode',[
'options'=>['tag'=>'li','class'=>'checkcode'],
'errorOptions'=>['tag'=>'span','style'=>'color:red;'],
'hintOptions'=>['tag'=>'p'],
'labelOptions'=>['tag'=>'label'],
'template'=>"{label}\n{input}\n{error}\n{hint}"
])->widget(Captcha::className(),
[
'options'=>['placeholder'=>'验证码'],
'captchaAction' => 'user/captcha',
'imageOptions'=>['style'=>'height:36px;width:150px;cursor:pointer','title'=>'点击刷新'],
'template'=>"{input}\n{image}<span>看不清?<a href=''>换一张</a></span>",
]);
客户端yii自带的ajax验证通过, 提交就报验证码错误
怎么弄啊
共 3 条回复
蜗牛大师兄
注册时间:2016-03-10
最后登录:2016-12-02
在线时长:5小时49分
最后登录:2016-12-02
在线时长:5小时49分
- 粉丝1
- 金钱120
- 威望0
- 积分170