Route extends Route
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.
Table of Contents
Properties
- $aspects : array<string, AspectInterface>
- $compiled : CompiledRoute|null
Methods
- __construct() : mixed
- addAspects() : $this
- Adds aspects to the existing maps.
- filterAspects() : array<string|int, AspectInterface>
- getArguments() : array<string|int, mixed>
- getAspect() : AspectInterface|null
- Returns the aspect for the given key.
- getAspects() : array<string, AspectInterface>
- getEnhancer() : EnhancerInterface|null
- hasAspect() : bool
- Checks if an aspect is set for the given key.
- setAspect() : $this
- Sets an aspect for the given key.
- setAspects() : $this
- Sets the aspects and removes existing ones.
Properties
$aspects
protected
array<string, AspectInterface>
$aspects
= []
$compiled
protected
CompiledRoute|null
$compiled
Methods
__construct()
public
__construct(string $path[, array<string|int, mixed> $defaults = [] ][, array<string|int, mixed> $requirements = [] ][, array<string|int, mixed> $options = [] ][, string|null $host = '' ][, mixed $schemes = [] ][, mixed $methods = [] ][, string|null $condition = '' ][, array<string|int, mixed> $aspects = [] ]) : mixed
Parameters
- $path : string
- $defaults : array<string|int, mixed> = []
- $requirements : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
- $host : string|null = ''
- $schemes : mixed = []
- $methods : mixed = []
- $condition : string|null = ''
- $aspects : array<string|int, mixed> = []
addAspects()
Adds aspects to the existing maps.
public
addAspects(array<string, AspectInterface> $aspects) : $this
This method implements a fluent interface.
Parameters
- $aspects : array<string, AspectInterface>
Return values
$thisfilterAspects()
public
filterAspects(array<string|int, string> $classNames[, array<string|int, string> $variableNames = [] ]) : array<string|int, AspectInterface>
Parameters
- $classNames : array<string|int, string>
-
All (logical AND) class names that must match (including interfaces, abstract classes and traits)
- $variableNames : array<string|int, string> = []
-
Variable names to be filtered
Return values
array<string|int, AspectInterface>getArguments()
public
getArguments() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getAspect()
Returns the aspect for the given key.
public
getAspect(string $key) : AspectInterface|null
Parameters
- $key : string
-
The key
Return values
AspectInterface|null —The regex or null when not given
getAspects()
public
getAspects() : array<string, AspectInterface>
Return values
array<string, AspectInterface>getEnhancer()
public
getEnhancer() : EnhancerInterface|null
Return values
EnhancerInterface|nullhasAspect()
Checks if an aspect is set for the given key.
public
hasAspect(string $key) : bool
Parameters
- $key : string
-
A variable name
Return values
bool —true if an aspect is specified, false otherwise
setAspect()
Sets an aspect for the given key.
public
setAspect(string $key, AspectInterface $aspect) : $this
Parameters
- $key : string
-
The key
- $aspect : AspectInterface
Return values
$thissetAspects()
Sets the aspects and removes existing ones.
public
setAspects(array<string, AspectInterface> $aspects) : $this
This method implements a fluent interface.
Parameters
- $aspects : array<string, AspectInterface>