Skip to content

Commit

Permalink
update reamde
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 7, 2017
1 parent 395377b commit 9ae5a61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ class PageRequest extends Validation
{
return [
['tagId,title,userId,freeTime', 'required'],
['tagId', 'size', 'min'=>4, 'max'=>567], // 4<= tagId <=567
['title', 'min', 40],
['tagId', 'size', 'min'=>4, 'max'=>567, 'filter' => 'int'], // 4<= tagId <=567
['title', 'min', 40, 'filter' => 'trim'],
['freeTime', 'number'],
['tagId', 'number', 'when' => function($data) {
return isset($data['status']) && $data['status'] > 2;
}],
['userId', 'number', 'on' => 'scene1' ],
['username', 'string', 'on' => 'scene2' ],
['userId', 'number', 'on' => 'scene1', 'filter' => 'int'],
['username', 'string', 'on' => 'scene2', 'filter' => 'trim'],
['username', 'regexp' ,'/^[a-z]\w{2,12}$/'],
['title', 'customValidator', 'msg' => '{attr} error msg!' ], // 指定当前规则的消息
['status', function($status) { // 直接使用闭包验证
Expand Down

0 comments on commit 9ae5a61

Please sign in to comment.