{"action":"created","issue":{"url":"https://api.github.com/repos/acemureithi/f3-validate/issues/2","repository_url":"https://api.github.com/repos/acemureithi/f3-validate","labels_url":"https://api.github.com/repos/acemureithi/f3-validate/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/acemureithi/f3-validate/issues/2/comments","events_url":"https://api.github.com/repos/acemureithi/f3-validate/issues/2/events","html_url":"https://github.com/acemureithi/f3-validate/issues/2","id":150054386,"number":2,"title":"Add Same Rule","user":{"login":"kavin-90","id":15142270,"avatar_url":"https://avatars.githubusercontent.com/u/15142270?v=3","gravatar_id":"","url":"https://api.github.com/users/kavin-90","html_url":"https://github.com/kavin-90","followers_url":"https://api.github.com/users/kavin-90/followers","following_url":"https://api.github.com/users/kavin-90/following{/other_user}","gists_url":"https://api.github.com/users/kavin-90/gists{/gist_id}","starred_url":"https://api.github.com/users/kavin-90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavin-90/subscriptions","organizations_url":"https://api.github.com/users/kavin-90/orgs","repos_url":"https://api.github.com/users/kavin-90/repos","events_url":"https://api.github.com/users/kavin-90/events{/privacy}","received_events_url":"https://api.github.com/users/kavin-90/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-21T12:06:00Z","updated_at":"2016-04-21T12:34:27Z","closed_at":null,"body":"Please Add Same Rule so Password and Password_confirmed work correctly.\r\n\r\nCurrently there is no **same** rule so validation can't match if both field contain same value\r\n\r\nexample of it usage should be **same:password** \r\n"},"comment":{"url":"https://api.github.com/repos/acemureithi/f3-validate/issues/comments/212898265","html_url":"https://github.com/acemureithi/f3-validate/issues/2#issuecomment-212898265","issue_url":"https://api.github.com/repos/acemureithi/f3-validate/issues/2","id":212898265,"user":{"login":"acemureithi","id":6939342,"avatar_url":"https://avatars.githubusercontent.com/u/6939342?v=3","gravatar_id":"","url":"https://api.github.com/users/acemureithi","html_url":"https://github.com/acemureithi","followers_url":"https://api.github.com/users/acemureithi/followers","following_url":"https://api.github.com/users/acemureithi/following{/other_user}","gists_url":"https://api.github.com/users/acemureithi/gists{/gist_id}","starred_url":"https://api.github.com/users/acemureithi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acemureithi/subscriptions","organizations_url":"https://api.github.com/users/acemureithi/orgs","repos_url":"https://api.github.com/users/acemureithi/repos","events_url":"https://api.github.com/users/acemureithi/events{/privacy}","received_events_url":"https://api.github.com/users/acemureithi/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T12:34:27Z","updated_at":"2016-04-21T12:34:27Z","body":"What about:\r\n\r\n```php\r\nValidate::add_validator(\"same\", function($field, $input, $param = NULL) {\r\n    return $input[$field] === input[$param]\r\n});\r\n```\r\nUsage\r\n```php\r\n$data = $f3->get('POST')\r\n$valid = Validate::is_valid($data, array(\r\n    'username' => 'required|alpha_numeric',\r\n    'password' => 'required|max_len,100|min_len,6'\r\n    'password_confirmed' => 'required|same,password'\r\n));\r\n\r\nif($valid === true) {\r\n    // continue\r\n} else {\r\n    print_r($valid);\r\n}\r\n```\r\nPlease try it(Not Tested)"}}