Skip to content

Commit 9ae5a61

Browse files
committed
update reamde
1 parent 395377b commit 9ae5a61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ class PageRequest extends Validation
9898
{
9999
return [
100100
['tagId,title,userId,freeTime', 'required'],
101-
['tagId', 'size', 'min'=>4, 'max'=>567], // 4<= tagId <=567
102-
['title', 'min', 40],
101+
['tagId', 'size', 'min'=>4, 'max'=>567, 'filter' => 'int'], // 4<= tagId <=567
102+
['title', 'min', 40, 'filter' => 'trim'],
103103
['freeTime', 'number'],
104104
['tagId', 'number', 'when' => function($data) {
105105
return isset($data['status']) && $data['status'] > 2;
106106
}],
107-
['userId', 'number', 'on' => 'scene1' ],
108-
['username', 'string', 'on' => 'scene2' ],
107+
['userId', 'number', 'on' => 'scene1', 'filter' => 'int'],
108+
['username', 'string', 'on' => 'scene2', 'filter' => 'trim'],
109109
['username', 'regexp' ,'/^[a-z]\w{2,12}$/'],
110110
['title', 'customValidator', 'msg' => '{attr} error msg!' ], // 指定当前规则的消息
111111
['status', function($status) { // 直接使用闭包验证

0 commit comments

Comments
 (0)