Skip to content

Commit 296e933

Browse files
ADding in documentation for multiple routes
1 parent 98f9a6f commit 296e933

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ Respect\Rest sort routes automatically, but it is highly recommended to declare
166166
from the most specific to the most generic. This will improve performance and
167167
maintainability of the code.
168168

169+
### Multiple Routes
170+
[Top][]
171+
172+
You may want to have multiple routes perform the same action. Pluralization is the most common reason for this. This can be done like so:
173+
```php
174+
$r3->get(array('/user/*', '/users/*'), function($userName) {
175+
return 'Hello '. $userName;
176+
});
177+
```
178+
169179
### Matching any HTTP Method
170180
[Top][]
171181

@@ -609,4 +619,4 @@ this side route. Similarly, there is a route for PHP errors:
609619
[RESTful Extras]: #restful-extras
610620
[Anti-Patterns]: #anti-patterns
611621
[Own Routines]: #your-own-routines
612-
[Error Handling]: #error-handling
622+
[Error Handling]: #error-handling

0 commit comments

Comments
 (0)