TYPO3  7.6
Public Member Functions | Protected Attributes | List of all members
Router Class Reference
Inheritance diagram for Router:
SingletonInterface

Public Member Functions

 addRoute ($routeIdentifier, $route)
 
 getRoutes ()
 
 match ($pathInfo)
 
 matchRequest (ServerRequestInterface $request)
 

Protected Attributes

 $routes = array()
 

Detailed Description

Implementation of a class for adding routes, collecting throughout the Bootstrap to register all sorts of Backend Routes, and to fetch the main Collection in order to resolve a route (see ->match() and ->matchRequest()).

Ideally, the Router is solely instantiated and accessed via the Bootstrap, the RequestHandler and the UriBuilder.

See for more details on route matching() and Bootstrap->initializeBackendRouting().

The architecture is inspired by the Symfony Routing Component.

Definition at line 31 of file Router.php.

Member Function Documentation

addRoute (   $routeIdentifier,
  $route 
)

Adds a new route with the identifiers

Parameters
string$routeIdentifier
Route$route

Definition at line 46 of file Router.php.

getRoutes ( )

Fetch all registered routes, only use in UriBuilder

Returns
Route[]

Definition at line 56 of file Router.php.

References Router\$routes.

match (   $pathInfo)

Tries to match a URL path with a set of routes.

Parameters
string$pathInfoThe path info to be parsed
Returns
Route the first Route object found
Exceptions
ResourceNotFoundExceptionIf the resource could not be found

Definition at line 68 of file Router.php.

Referenced by Router\matchRequest().

matchRequest ( ServerRequestInterface  $request)

Tries to match a URI against the registered routes

Parameters
ServerRequestInterface$request
Returns
Route the first Route object found

Definition at line 87 of file Router.php.

References ServerRequestInterface\getAttribute(), and Router\match().

Member Data Documentation

$routes = array()
protected

Definition at line 38 of file Router.php.

Referenced by Router\getRoutes().