Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
Merge 0d3abca into c3a0823
Browse files Browse the repository at this point in the history
  • Loading branch information
MeroveeCharrue committed Apr 17, 2019
2 parents c3a0823 + 0d3abca commit b725019
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,21 @@ At the end in the controller, you will have true json, xml for payload & integer

### Automatic binding route

**RREST** bind the route to a controller by following this convention:
**RREST** binds the route to a controller by following this convention:
* `POST /item/` -> `Controllers\Item#postAction`
* `GET /item/{itemId}/` -> `Controllers\Item#getAction`
* `GET /item/{itemId}/comment` -> `Controllers\Item\Comment#getAction`
* `PUT /item/{itemId}/comment/{commentId}` -> `Controllers\Item\Comment#putAction`

> note you can define the controller namespace (here Controllers) in the RREST\RREST constructor
> Note: You can define the controller namespace (here Controllers) in the RREST\RREST constructor
> Note: Currently, the order of API definitions matters. See this as an example :
> ```raml
> /item/{itemId}
> /item/archive
> ```
> Calling `GET /item/archive` will be matched to the first endpoint, with value "archive" for {itemId}.
> To prevent this, simply order endpoint definitions.
### Response
Expand Down

0 comments on commit b725019

Please sign in to comment.