Skip to content

Commit

Permalink
new example added
Browse files Browse the repository at this point in the history
  • Loading branch information
rrd108 committed Oct 23, 2021
1 parent 1e1bf3b commit 6e90d24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Then, to load the plugin either run the following command:
bin/cake plugin load JsonApiException
```

or manually add the following line to your app's `src/Application.php `file's `bootstrap()` function:
or manually add the following line to your app's `src/Application.php` file's `bootstrap()` function:

```php
$this->addPlugin('JsonApiException');
Expand All @@ -43,6 +43,7 @@ public function add()
$user = $this->Users->patchEntity($user, $this->request->getData());
if (!$this->Users->save($user)) {
throw new JsonApiException($user, 'Save failed');
// throw new JsonApiException($user, 'Save failed', 418); // you set the response's status code in the 3rd parameter
}
}
$this->set(compact('user'));
Expand Down

0 comments on commit 6e90d24

Please sign in to comment.