$routes
$routes : array
Routes array.
Router class.
The Router
class is responsible for managing routes and dispatching requests to the appropriate handlers.
$current : \Omega\Routing\Route
Current route.
get(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Get method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
post(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Post method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
put(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Put method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
delete(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Delete method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
patch(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Patch method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
options(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Options method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
any(string $path, mixed $handler, ?string $name = null) : \Omega\Routing\Route
Any method.
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
?string | $name | Holds the route name or null. |
Returns the added Route instance.
addRoute(string $method, string $path, mixed $handler, string|null $name = null) : \Omega\Routing\Route
Add a route to the router.
string | $method | Holds the HTTP method for the route. |
string | $path | Holds the path pattern for the route. |
mixed | $handler | Holds the handler for the route. |
string|null | $name | Holds the route name or null. |
Return the added Route instance.