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 29
protected array
splitFunctionAndParameters(string $function)
Splits function name and parameters into an array.
in FunctionParserTrait at line 48
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 86
Router
registerConstraint(string $name, string $constraint)
Registers constraint.
at line 99
Router
setConstraintAsGlobal(array $constraint)
Sets the chosen constraint as global.
at line 113
protected bool
matches(Route $route, string $path)
Returns TRUE if the route matches the request path and FALSE if not.
at line 141
protected ConstraintInterface
constraintFactory(string $constraint)
Constraint factory.
at line 161
protected bool
constraintsAreSatisfied(Route $route)
Returns TRUE if all the route constraints are satisfied and FALSE if not.
at line 180
protected Route
redirectRoute(string $requestPath)
Returns a route with a closure action that redirects to the correct URL.
at line 203
protected array
getAllowedMethodsForMatchingRoutes(string $requestPath)
Returns an array of all allowed request methods for the requested route.
at line 224
protected Route
optionsRoute(string $requestPath)
Returns a route with a closure action that sets the allow header.