StaticRouteResolver

class \TYPO3\CMS\Frontend\Middleware\StaticRouteResolver

Implements
MiddlewareInterface

Resolves static routes - can return configured content directly or load content from file / urls

Table of Contents

Interfaces

MiddlewareInterface

Properties

$linkService  : LinkService
$requestFactory  : RequestFactory

Methods

__construct()  : mixed
process()  : ResponseInterface
Checks if there is a valid site with route configuration.
getApplicableStaticRoute()  : array|null
Find the proper configuration for the static route in the static route configuration. Mainly: - needs to have a valid "route" property - needs to have a "type"
getFromFile()  : array
getFromUri()  : array
getPageUri()  : string
resolveByType()  : array

Properties

Methods

process()

Checks if there is a valid site with route configuration.

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface

Parameters

$request : ServerRequestInterface
$handler : RequestHandlerInterface

Return values

ResponseInterface

getApplicableStaticRoute()

Find the proper configuration for the static route in the static route configuration. Mainly: - needs to have a valid "route" property - needs to have a "type"

protected getApplicableStaticRoute(array $staticRouteConfiguration, Site $site, string $uriPath) : array|null

Parameters

$staticRouteConfiguration : array

the "routes" part of the site configuration

$site : Site

the current site where the configuration is based on

$uriPath : string

the path of the current request - used to match the "route" value of a single static route

Return values

array|null —

the configuration for the static route that matches, or null if no route is given

getFromFile()

protected getFromFile(File $file) : array

Parameters

$file : File

Return values

array

getFromUri()

protected getFromUri(string $uri) : array

Parameters

$uri : string

Return values

array

getPageUri()

protected getPageUri(ServerRequestInterface $request, Site $site, array $urlParams) : string

Parameters

$request : ServerRequestInterface
$site : Site
$urlParams : array

Tags

throws
InvalidRouteArgumentsException

Return values

string

resolveByType()

protected resolveByType(ServerRequestInterface $request, Site $site, string $type, array $routeConfig) : array

Parameters

$request : ServerRequestInterface
$site : Site
$type : string
$routeConfig : array

Tags

throws
InvalidRouteArgumentsException

Return values

array
On this page