TP5.1控制器验证器如何自定义方法?

浏览:3257 发布日期:2019/08/21 分类:ThinkPHP5专区
 $validate = $this->validate($pwData, [
            'oldPsw' => 'require|checkPwd',
            'newPsw' => 'require',
            'rePsw' => 'require|confirm:newPsw',
        ], [
            'oldPsw.require' => '原始密码不能为空',
            'newPsw.captcha' => '新密码不能为空',
            'rePsw.require' => '确认密码不能为空',
            'rePsw.confirm' => '两次输入的密码不一致',
        ]);
checkPwd是我的自定义验证,在哪里定义这个函数
最佳答案
评论() 相关
后面还有条评论,点击查看>>