标签:space 手册 div think this post ext ESS val
看了手册,一脸蒙蔽,完全不知道手册写的什么:
不废话 直接写案例
第一步 验证器中的验证规则如下:
namespace app\index\validate; use think\Validate; class User extends Validate { protected $rule = [ ‘ceshi‘=>[‘require‘,‘captcha‘] ]; protected $message = [ ]; protected $scene = [ ‘edit‘ => [‘ceshi‘], ]; }
第二部 控制器中这样使用:
//验证码图片测试 public function tp(Request $request) { $data = $request->post(); $result = $this->validate($data, "User.edit"); dump($result); }
标签:space 手册 div think this post ext ESS val
原文地址:https://www.cnblogs.com/cbywan/p/10060706.html