Route
class Route extends Route
A wrapper for a controller, mapped to a route.
Methods
__construct(string $path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), string $host = '', string|array $schemes = array(), string|array $methods = array())
Constructor.
requireHttp()
Sets the requirement of HTTP (no HTTPS) on this Route.
requireHttps()
Sets the requirement of HTTPS on this Route.
Details
at line 38
__construct(string $path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), string $host = '', string|array $schemes = array(), string|array $methods = array())
Constructor.
Available options:
- compiler_class: A class name able to compile this route instance (RouteCompiler by default)
at line 51
Route
run(callable $to)
Sets the route code that should be executed when matched.
at line 66
Route
assert(string $variable, string $regexp)
Sets the requirement for a route variable.
at line 81
Route
value(string $variable, mixed $default)
Sets the default value for a route variable.
at line 96
Route
convert(string $variable, mixed $callback)
Sets a converter for a route variable.
at line 112
Route
method(string $method)
Sets the requirement for the HTTP method.
at line 126
Route
host(string $host)
Sets the requirement of host on this Route.
at line 138
Route
requireHttp()
Sets the requirement of HTTP (no HTTPS) on this Route.
at line 150
Route
requireHttps()
Sets the requirement of HTTPS on this Route.
at line 164
Route
before(mixed $callback)
Sets a callback to handle before triggering the route callback.
at line 180
Route
after(mixed $callback)
Sets a callback to handle after the route callback.
at line 196
Route
when(string $condition)
Sets a condition for the route to match.