Toro is a PHP router for developing RESTful web applications and APIs.
It is designed for minimalists who want to get work done.
First, create a handler to support the
serve with an array of routes.
Routes are expressed as an associative array.
Stubs, such as
:alpha, can be used instead of common regular expressions.
Of course, regular expressions are still welcome.
Handlers support all HTTP methods, such as
_xhr matches JSON requests.
_xhr method is not implemented, then the given request method is called.
Toro has a simple callback system called ToroHook.
There are five hooks:
Adding a hook pushes the anonymous function into an array.
When a hook is fired, all of the functions are called sequentially.