Skip to content

Commit feebe7b

Browse files
committed
Merge pull request #92 from blindsamson/multiple-paths
Adding in documentation for multiple routes
2 parents e02c0e6 + 296e933 commit feebe7b

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

@@ -614,4 +624,4 @@ this side route. Similarly, there is a route for PHP errors:
614624
[RESTful Extras]: #restful-extras
615625
[Anti-Patterns]: #anti-patterns
616626
[Own Routines]: #your-own-routines
617-
[Error Handling]: #error-handling
627+
[Error Handling]: #error-handling

0 commit comments

Comments
 (0)