$routes
$routes : array
Routes array.
Abstract router class.
The AbstractRouter
class serves as a foundation for implementing custom routers within
the Omega Routing Package. It provides a set of methods to add routes for different
HTTP methods and defines the dispatching behavior, allowing derived classes to handle
route matching and execution of associated handlers.
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.