Skip to content

Commit

Permalink
More info about the errors in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidePastore committed Jan 2, 2016
1 parent a1cdeee commit acc74b7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ $app->get('/api/myEndPoint',function ($req, $res, $args) {
if($this->validation->hasErrors()){
//There are errors, read them
$errors = $this->getErrors();

/* $errors contain:
array(
'username' => array(
'"davidepastore" must have a length between 1 and 10',
),
'age' => array(
'"89" must be lower than or equals 20',
),
);
*/
} else {
//No errors
}
Expand Down Expand Up @@ -95,6 +106,17 @@ $app->get('/foo', function ($req, $res, $args) {
if($this->validation->hasErrors()){
//There are errors, read them
$errors = $this->getErrors();

/* $errors contain:
array(
'username' => array(
'"davidepastore" must have a length between 1 and 10',
),
'age' => array(
'"89" must be lower than or equals 20',
),
);
*/
} else {
//No errors
}
Expand Down

0 comments on commit acc74b7

Please sign in to comment.