Skip to content

Commit

Permalink
More route stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
anandkunal committed Aug 16, 2012
1 parent bc960f2 commit e2a5975
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,29 @@ Toro::serve(Array(
));
```

Pattern matches are passed in order as arguments to the handler's request method. In the case of `ProductHandler` above:

```php
<?php

class ProductHandler extends ToroHandler {
function get($name) {
echo "You want to see product: $name";
}
}
```


## RESTful Handlers

```php
<?php

class ExampleHandler extends ToroHandler {
function get() { } // GET
function post() { } // POST
function get_xhr() { } // GET (JSON/XHR)
function post_xhr() { } // POST (JSON/XHR)
function get() { }
function post() { }
function get_xhr() { }
function post_xhr() { }
}
```

Expand Down

0 comments on commit e2a5975

Please sign in to comment.