Router
class Router (View source)
The Router class handles the registration and evaluation of routes.
Properties
private | $routes | The routes array. |
Methods
__construct()
The constructor.
get(string $url)
Test a given URL against the registered route patterns and return a matching function.
register(string $route, callable $callable)
Register a new route.
Details
at line 57
__construct()
The constructor.
at line 68
get(string $url)
Test a given URL against the registered route patterns and return a matching function.
Note that the routes are testes in order they are stored in the routes array. Therefore it is important that the most generic routes are registered last.
at line 86
register(string $route, callable $callable)
Register a new route.