com\setasign\SetaFramework\Router\Route
Multi Class Route Multi
File: /SetaFramework/src/Router/Route/Multi.php
Class hierarchy
Implements
- \Psr\Log\LoggerAwareInterface
- RouteInterface
Summary
Constants
DEFAULT_PRIORITY
Properties
$logger
$mainRoute
Methods
__construct()
This route can have own sub-routes which will only checked if the mainRoute is matching.
Parameters
- $mainRoute : RouteInterface
Contains the main route of this
appendRoute()
RouteInterface $route,
string $after = '',
int $priority = \com\setasign\SetaFramework\Router\AbstractRouter::DEFAULT_PRIORITY
Append a route after the route $after.
If $after is an empty string than the added route will be the last route.
The name of the route need to be unique.
Parameters
- $name : string
Name of the new route
- $route : RouteInterface
Route
- $after : string
Append this route after the route with this name
- $priority : int
Exceptions
getRoute()
Returns a route
Parameters
- $routeName : string
Exceptions
Throws \InvalidArgumentException
prependRoute()
RouteInterface $route,
string $before = '',
int $priority = \com\setasign\SetaFramework\Router\AbstractRouter::DEFAULT_PRIORITY
Prepend a route before the route $before.
If $before is an empty string than the added route will be the first route.
The name of the route need to be unique.
Parameters
- $name : string
Name of the new route
- $route : RouteInterface
Route
- $before : string
Prepend this route before the route with this name
- $priority : int
Exceptions
process()
Calls the match-method of all routes in the correct order and break if one route is matching
The result of a matching route will be merged with the default values of this and will be returned
Parameters
- $request : \Psr\Http\Message\RequestInterface
Exceptions
resolveAppendingRoutes()
Parameters
- $name : string
resolvePrependingRoutes()
Parameters
- $name : string
setDefaultValue()
Proxy method for mainRoute->setDefaultValue
Parameters
- $key : string
The key shouldn't be a natural number
- $value : mixed
See
setDefaultValues()
Proxy method for mainRoute->setDefaultValues
Parameters
- $defaultValues : array<string, mixed>
The keys of this array shouldn't be natural numbers
See
setLogger()
Sets a logger instance on the object.
Parameters
- $logger : \Psr\Log\LoggerInterface
