top-think / think

ThinkPHP Framework ——十年匠心的高性能PHP框架
http://www.thinkphp.cn
Other
7.83k stars 1.62k forks source link

场景验证覆盖重写 #970

Open ghost opened 5 years ago

ghost commented 5 years ago

protected $rule=[ 'name' => 'require|length:2,20|alphaDash', ]

protected $scene=[ 'test' => ['name'=>'require|number'] ] $validate->scene('test')->check($post); 为何不会走场景验证,使用这种方式覆盖重写规则,怎么没有效果,而且$rule 里面的验证规则也失效了, 版本5.1.28 LTS,请问5.1 是不支持这种写法了吗

5.0 手册场景验证 搜狗截图20191002145731