Yii2下如何实现点击验证码的切换-创新互联
小编给大家分享一下Yii2下如何实现点击验证码的切换,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
模型代码如下:
'/admin/login/captcha','message'=>'{attribute}'], [['password','username'],'required'], ]; } }
控制器代码如下:
'yii\captcha\CaptchaAction', 'maxLength'=>4, 'minLength'=>3, 'width'=>10, 'height'=>10 ]; } public function actionIndex(){ $log = new LoginForm(); return $this->renderPartial("index",['model'=>$log]); } //授权规则 }
视图代码如下:
beginPage()?>博客后台管理系统 beginBody()?>