‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Routing\Route Class Reference
Inheritance diagram for TYPO3\CMS\Core\Routing\Route:

Public Member Functions

array __construct (string $path, array $defaults=[], array $requirements=[], array $options=[], ?string $host='', $schemes=[], $methods=[], ?string $condition='', array $aspects=[])
 
 getArguments ()
 
 getEnhancer ()
 
array getAspects ()
 
$this setAspects (array $aspects)
 
$this addAspects (array $aspects)
 
AspectInterface null getAspect (string $key)
 
bool hasAspect (string $key)
 
$this setAspect (string $key, AspectInterface $aspect)
 
AspectInterface[] filterAspects (array $classNames, array $variableNames=[])
 

Protected Attributes

CompiledRoute null $compiled
 
AspectInterface[] $aspects = array( )
 

Detailed Description

TYPO3's route is built on top of Symfony's route with some special handling of "Aspects" built on top of a route

as this is tightly coupled to Symfony's Routing and we try to encapsulate this, please note that this might change if we change the under-the-hood implementation.

Definition at line 31 of file Route.php.

Constructor & Destructor Documentation

◆ __construct()

array TYPO3\CMS\Core\Routing\Route::__construct ( string  $path,
array  $defaults = [],
array  $requirements = [],
array  $options = [],
?string  $host = '',
  $schemes = [],
  $methods = [],
?string  $condition = '',
array  $aspects = [] 
)

Definition at line 42 of file Route.php.

References TYPO3\CMS\Core\Routing\Route\setAspects().

Member Function Documentation

◆ addAspects()

$this TYPO3\CMS\Core\Routing\Route::addAspects ( array  $aspects)

Adds aspects to the existing maps.

This method implements a fluent interface.

Parameters
array$aspects‪The aspects
Returns
‪$this

Definition at line 102 of file Route.php.

References TYPO3\CMS\Core\Routing\Route\$aspects.

Referenced by TYPO3\CMS\Core\Routing\Route\setAspects().

◆ filterAspects()

AspectInterface [] TYPO3\CMS\Core\Routing\Route::filterAspects ( array  $classNames,
array  $variableNames = [] 
)
Parameters
string[]$classNames‪All (logical AND) class names that must match (including interfaces, abstract classes and traits)
string[]$variableNames‪Variable names to be filtered
Returns
‪AspectInterface[]

Definition at line 158 of file Route.php.

References TYPO3\CMS\Core\Routing\Route\$aspects.

Referenced by TYPO3\CMS\Core\Routing\PageRouter\assertMaximumStaticMappableAmount(), TYPO3\CMS\Core\Routing\Enhancer\SimpleEnhancer\buildResult(), TYPO3\CMS\Core\Routing\Enhancer\PluginEnhancer\buildResult(), and TYPO3\CMS\Core\Routing\Aspect\MappableProcessor\fetchMappers().

◆ getArguments()

TYPO3\CMS\Core\Routing\Route::getArguments ( )

◆ getAspect()

AspectInterface null TYPO3\CMS\Core\Routing\Route::getAspect ( string  $key)

Returns the aspect for the given key.

Parameters
string$key‪The key
Returns
‪AspectInterface|null The regex or null when not given

Definition at line 123 of file Route.php.

◆ getAspects()

array TYPO3\CMS\Core\Routing\Route::getAspects ( )

◆ getEnhancer()

TYPO3\CMS\Core\Routing\Route::getEnhancer ( )

Definition at line 65 of file Route.php.

Referenced by TYPO3\CMS\Core\Routing\PageRouter\buildPageArguments().

◆ hasAspect()

bool TYPO3\CMS\Core\Routing\Route::hasAspect ( string  $key)

Checks if an aspect is set for the given key.

Parameters
string$key‪A variable name
Returns
‪bool true if an aspect is specified, false otherwise

Definition at line 134 of file Route.php.

◆ setAspect()

$this TYPO3\CMS\Core\Routing\Route::setAspect ( string  $key,
AspectInterface  $aspect 
)

Sets an aspect for the given key.

Parameters
string$key‪The key
Returns
‪$this

Definition at line 145 of file Route.php.

◆ setAspects()

$this TYPO3\CMS\Core\Routing\Route::setAspects ( array  $aspects)

Sets the aspects and removes existing ones.

This method implements a fluent interface.

Parameters
array$aspects‪The aspects
Returns
‪$this

Definition at line 88 of file Route.php.

References TYPO3\CMS\Core\Routing\Route\addAspects().

Referenced by TYPO3\CMS\Core\Routing\Route\__construct(), and TYPO3\CMS\Core\Routing\Enhancer\AbstractEnhancer\applyRouteAspects().

Member Data Documentation

◆ $aspects

AspectInterface [] TYPO3\CMS\Core\Routing\Route::$aspects = array( )
protected

◆ $compiled

CompiledRoute null TYPO3\CMS\Core\Routing\Route::$compiled
protected
Returns
‪array

Definition at line 36 of file Route.php.