Router
class Router
Router.
Traits
Properties
protected Routes | $routes | Route collection. | |
protected Container | $container | Container. | |
protected array | $constraints | Constraints. | |
protected array | $globalConstraints | Global constraints. |
Methods
Splits function name and parameters into an array.
Parses custom "function calls".
Registers constraint.
Sets the chosen constraint as global.
Constraint factory.
Returns TRUE if all the route constraints are satisfied and FALSE if not.
Returns a route with a closure action that redirects to the correct URL.
Returns an array of all allowed request methods for the requested route.
Returns a route with a closure action that sets the allow header.
Details
in FunctionParserTrait at line 31
protected array
splitFunctionAndParameters(string $function)
Splits function name and parameters into an array.
in FunctionParserTrait at line 50
protected array
parseFunction(string $function, bool|null $namedParameters = null)
Parses custom "function calls".
The return value is an array consisting of the function name and parameters.
at line 88
Router
registerConstraint(string $name, string $constraint)
Registers constraint.
at line 101
Router
setConstraintAsGlobal(array $constraint)
Sets the chosen constraint as global.
at line 115
protected bool
matches(Route $route, string $path)
Returns TRUE if the route matches the request path and FALSE if not.
at line 143
protected ConstraintInterface
constraintFactory(string $constraint)
Constraint factory.
at line 163
protected bool
constraintsAreSatisfied(Route $route)
Returns TRUE if all the route constraints are satisfied and FALSE if not.
at line 182
protected Route
redirectRoute(string $requestPath)
Returns a route with a closure action that redirects to the correct URL.
at line 205
protected array
getAllowedMethodsForMatchingRoutes(string $requestPath)
Returns an array of all allowed request methods for the requested route.
at line 226
protected Route
optionsRoute(string $requestPath)
Returns a route with a closure action that sets the allow header.