We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: 验证器, @integer 方式验证数据存在漏洞,传字符串也可以验证通过;
建议优化: 现在的验证器,功能不是很好用,希望添加下 验证场景 方式验证参数,可以借鉴下TP的验证方式 以下是TP5.1的验证方式 class Tencent extends Validate { // 验证参数 protected $rule = [ 'num' => 'require', 'content' => 'require' ]; // 验证错误文案 protected $message = [ 'num.require' => 'num不能为空', 'content.require' => '内容不能为空' ]; // 验证tag protected $scene = [ 'postOften' => ['num','content'] ]; } $validate = new Tencent; $validate->scene('postOften')->check($data);
The text was updated successfully, but these errors were encountered:
修复 Integer 验证注解 #53
4f310ec
新增支持验证器的场景定义 #53
2b13c45
问题已经修复,场景验证也已支持,具体可以查看文档:https://doc.imiphp.com/components/validation/index.html
Sorry, something went wrong.
No branches or pull requests
BUG:
验证器, @integer 方式验证数据存在漏洞,传字符串也可以验证通过;
建议优化:
现在的验证器,功能不是很好用,希望添加下 验证场景 方式验证参数,可以借鉴下TP的验证方式
以下是TP5.1的验证方式
class Tencent extends Validate {
// 验证参数
protected $rule = [
'num' => 'require',
'content' => 'require'
];
// 验证错误文案
protected $message = [
'num.require' => 'num不能为空',
'content.require' => '内容不能为空'
];
// 验证tag
protected $scene = [
'postOften' => ['num','content']
];
}
$validate = new Tencent;
$validate->scene('postOften')->check($data);
The text was updated successfully, but these errors were encountered: