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 35
static
addMethod(string $methodName, Closure $closure)
Adds a method to the class.
in ExtendableTrait at line 47
mixed
__call(string $name, array $arguments)
Executes class extensions.
in ExtendableTrait at line 64
static mixed
__callStatic(string $name, array $arguments)
Executes class extensions.
at line 59
array
getRoutes()
Returns the registered routes.
at line 70
array
getRoutesByMethod(string $method)
Returns the registered routes that accept the request method.
at line 81
bool
hasNamedRoute(string $name)
Returns TRUE if the named route exists and FALSE if not.
at line 92
Route
getNamedRoute(string $name)
Returns the named route.
at line 108
group(array $options, Closure $routes)
Adds a grouped set of routes to the colleciton.
at line 126
protected Route
registerRoute(array $methods, string $route, string|Closure $action, string|null $name = null)
Registers a route.
at line 164
Route
get(string $route, string|Closure $action, string|null $name = null)
Adds a route that responds to GET requests to the collection.
at line 177
Route
post(string $route, string|Closure $action, string|null $name = null)
Adds a route that responds to POST requests to the collection.
at line 190
Route
put(string $route, string|Closure $action, string|null $name = null)
Adds a route that responds to PUT requests to the collection.
at line 203
Route
patch(string $route, string|Closure $action, string|null $name = null)
Adds a route that responds to PATCH requests to the collection.
at line 216
Route
delete(string $route, string|Closure $action, string|null $name = null)
Adds a route that responds to DELETE requests to the collection.