Routes
class Routes
Route collection.
Traits
Properties
static protected array | $_extensions | Class extensions. | from ExtendableTrait |
protected array | $groups | Route groups. | |
protected array | $routes | Registered routes. | |
protected array | $groupedRoutes | Routes grouped by request method. | |
protected array | $namedRoutes | Named routes. |
Methods
Executes class extensions.
Returns the registered routes.
Returns the registered routes that accept the request method.
Returns TRUE if the named route exists and FALSE if not.
Returns the named route.
Registers a route.
Details
in ExtendableTrait at line 33
static
addMethod(string $methodName, Closure $closure)
Adds a method to the class.
in ExtendableTrait at line 45
mixed
__call(string $name, array $arguments)
Executes class extensions.
in ExtendableTrait at line 62
static mixed
__callStatic(string $name, array $arguments)
Executes class extensions.
at line 57
array
getRoutes()
Returns the registered routes.
at line 68
array
getRoutesByMethod(string $method)
Returns the registered routes that accept the request method.
at line 79
bool
hasNamedRoute(string $name)
Returns TRUE if the named route exists and FALSE if not.
at line 90
Route
getNamedRoute(string $name)
Returns the named route.
at line 106
group(array $options, Closure $routes)
Adds a grouped set of routes to the colleciton.
at line 124
protected Route
registerRoute(array $methods, string $route, Closure|string $action, string|null $name = null)
Registers a route.
at line 162
Route
get(string $route, Closure|string $action, string|null $name = null)
Adds a route that responds to GET requests to the collection.
at line 175
Route
post(string $route, Closure|string $action, string|null $name = null)
Adds a route that responds to POST requests to the collection.
at line 188
Route
put(string $route, Closure|string $action, string|null $name = null)
Adds a route that responds to PUT requests to the collection.
at line 201
Route
patch(string $route, Closure|string $action, string|null $name = null)
Adds a route that responds to PATCH requests to the collection.
at line 214
Route
delete(string $route, Closure|string $action, string|null $name = null)
Adds a route that responds to DELETE requests to the collection.