{"action":"closed","issue":{"url":"https://api.github.com/repos/top-think/framework/issues/391","repository_url":"https://api.github.com/repos/top-think/framework","labels_url":"https://api.github.com/repos/top-think/framework/issues/391/labels{/name}","comments_url":"https://api.github.com/repos/top-think/framework/issues/391/comments","events_url":"https://api.github.com/repos/top-think/framework/issues/391/events","html_url":"https://github.com/top-think/framework/issues/391","id":194331873,"number":391,"title":"验证器规则requireIf的建议","user":{"login":"caiweiming","id":7090770,"avatar_url":"https://avatars.githubusercontent.com/u/7090770?v=3","gravatar_id":"","url":"https://api.github.com/users/caiweiming","html_url":"https://github.com/caiweiming","followers_url":"https://api.github.com/users/caiweiming/followers","following_url":"https://api.github.com/users/caiweiming/following{/other_user}","gists_url":"https://api.github.com/users/caiweiming/gists{/gist_id}","starred_url":"https://api.github.com/users/caiweiming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caiweiming/subscriptions","organizations_url":"https://api.github.com/users/caiweiming/orgs","repos_url":"https://api.github.com/users/caiweiming/repos","events_url":"https://api.github.com/users/caiweiming/events{/privacy}","received_events_url":"https://api.github.com/users/caiweiming/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-08T13:10:05Z","updated_at":"2016-12-10T07:35:39Z","closed_at":"2016-12-10T07:35:39Z","body":"首先，这个规则很有用，但是只能验证某个字段为某一个值时才有效，建议能判断多个值，因为经常有些地方需要用到。\r\n\r\n比如\r\n\r\n`'password'=> ['requireIf' => 'account,1|2']`\r\n\r\n这样表示当account字段为1或者2时，password字段必须。\r\n\r\n或者这种形式\r\n\r\n`'password'=> 'requireIf:account,1^2'`\r\n\r\n也表示当account字段为1或者2时，password字段必须。"}}
{"actor":{"display_login":"caiweiming"}}