Skip to content

Commit

Permalink
Added example section
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjgreen committed Jul 22, 2015
1 parent 1f2960d commit dbe2b98
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ composer require phroute/phroute

Usage
-----
### Example

~~~PHP

$router->get('/example', function(){
return 'This route responds to requests with the GET method at the path /example';
});

$router->post('/example/{id}', function($id){
return 'This route responds to requests with the POST method at the path /example/1234. It passes in the parameter as a function argument.';
});

$router->any('/example', function(){
return 'This route responds to any method (POST, GET, DELETE, OPTIONS, HEAD etc...) at the path /example';
});
~~~


### Defining routes

Expand Down

0 comments on commit dbe2b98

Please sign in to comment.