Router
in package
This class is responsible for registering routes and resolving them.
Tags
Table of Contents
Properties
- $routes : mixed
Methods
- register() : void
- Register a route with the router
- resolve() : mixed
- Resolve a route
Properties
$routes
protected
mixed
$routes
= []
Methods
register()
Register a route with the router
public
register(string $method, string $path, mixed $action) : void
Parameters
- $method : string
-
HTTP method
- $path : string
-
URI path
- $action : mixed
-
Action to take when route is resolved
resolve()
Resolve a route
public
resolve(string $method, string $uri) : mixed
Parameters
- $method : string
-
HTTP method
- $uri : string
-
URI path