Tinywan / webman-validate

the most awesome validation library for webman plugin
https://www.workerman.net/webman
Apache License 2.0
14 stars 3 forks source link

转手函数提示错误 #5

Open sym134 opened 8 months ago

sym134 commented 8 months ago

错误内容: Typed property Tinywan\Validate\Validate::$currentScene must not be accessed before initialization

代码:

 validate($request->post(),[
            'device_id'      => 'require|number',
        ]);

助手函数不能这样写吗?

Tinywan commented 8 months ago

第二个参数需要指定验证器

validate($params, ScheduleValidate::class . '.im_group');
sym134 commented 8 months ago

第二个参数需要指定验证器

validate($params, ScheduleValidate::class . '.im_group');

validate方法写的,第二个参数可以传数组规则,意思实际不可以?

Tinywan commented 8 months ago

详细使用可以参考这里:https://doc.thinkphp.cn/v8_0/validator.html

sym134 commented 8 months ago
image

也是一样的错误

Tinywan commented 8 months ago

提示什么错误