‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Middleware\StaticRouteResolver Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Middleware\StaticRouteResolver:

Public Member Functions

ResponseInterface process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Protected Member Functions

array null getApplicableStaticRoute (array $staticRouteConfiguration, Site $site, string $uriPath)
 
array getFromFile (File $file)
 
array getFromUri (string $uri)
 
string getPageUri (ServerRequestInterface $request, Site $site, array $urlParams)
 
array resolveByType (ServerRequestInterface $request, Site $site, string $type, array $routeConfig)
 

Detailed Description

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

Definition at line 36 of file StaticRouteResolver.php.

Member Function Documentation

◆ getApplicableStaticRoute()

array null TYPO3\CMS\Frontend\Middleware\StaticRouteResolver::getApplicableStaticRoute ( array  $staticRouteConfiguration,
Site  $site,
string  $uriPath 
)
protected

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"
Parameters
array$staticRouteConfiguration‪the "routes" part of the site configuration
Site$site‪the current site where the configuration is based on
string$uriPath‪the path of the current request - used to match the "route" value of a single static route
Returns
‪array|null the configuration for the static route that matches, or null if no route is given

Definition at line 75 of file StaticRouteResolver.php.

References TYPO3\CMS\Core\Site\Entity\Site\getBase().

Referenced by TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\process().

◆ getFromFile()

array TYPO3\CMS\Frontend\Middleware\StaticRouteResolver::getFromFile ( File  $file)
protected

◆ getFromUri()

array TYPO3\CMS\Frontend\Middleware\StaticRouteResolver::getFromUri ( string  $uri)
protected
Parameters
string$uri
Returns
‪array

Definition at line 111 of file StaticRouteResolver.php.

Referenced by TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\resolveByType().

◆ getPageUri()

string TYPO3\CMS\Frontend\Middleware\StaticRouteResolver::getPageUri ( ServerRequestInterface  $request,
Site  $site,
array  $urlParams 
)
protected
Parameters
ServerRequestInterface$request
Site$site
array$urlParams
Returns
‪string
Exceptions
InvalidRouteArgumentsException

Definition at line 132 of file StaticRouteResolver.php.

References TYPO3\CMS\Core\Routing\RouterInterface\ABSOLUTE_URL, TYPO3\CMS\Core\Routing\RouterInterface\generateUri(), and TYPO3\CMS\Core\Site\Entity\Site\getRouter().

Referenced by TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\resolveByType().

◆ process()

ResponseInterface TYPO3\CMS\Frontend\Middleware\StaticRouteResolver::process ( ServerRequestInterface  $request,
RequestHandlerInterface  $handler 
)

Checks if there is a valid site with route configuration.

Parameters
ServerRequestInterface$request
RequestHandlerInterface$handler
Returns
‪ResponseInterface

Definition at line 45 of file StaticRouteResolver.php.

References TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\getApplicableStaticRoute(), and TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\resolveByType().

◆ resolveByType()

array TYPO3\CMS\Frontend\Middleware\StaticRouteResolver::resolveByType ( ServerRequestInterface  $request,
Site  $site,
string  $type,
array  $routeConfig 
)
protected
Parameters
ServerRequestInterface$request
Site$site
string$type
array$routeConfig
Returns
‪array
Exceptions
InvalidRouteArgumentsException

Definition at line 158 of file StaticRouteResolver.php.

References TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\getFromFile(), TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\getFromUri(), and TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\getPageUri().

Referenced by TYPO3\CMS\Frontend\Middleware\StaticRouteResolver\process().