‪TYPO3CMS  10.4
TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator Class Reference
Inheritance diagram for TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator:
TYPO3\CMS\Core\Routing\Enhancer\AbstractEnhancer TYPO3\CMS\Core\Routing\Enhancer\DecoratingEnhancerInterface TYPO3\CMS\Core\Routing\Enhancer\EnhancerInterface TYPO3\CMS\Core\Routing\Enhancer\EnhancerInterface

Public Member Functions

string getRoutePathRedecorationPattern ()
 
 decorateForMatching (RouteCollection $collection, string $routePath)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Routing\Enhancer\AbstractEnhancer
 setAspects (array $aspects)
 
 getAspects ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Routing\Enhancer\DecoratingEnhancerInterface
 decorateForGeneration (RouteCollection $collection, array $parameters)
 

Public Attributes

 $index = $configuration['index'] ?? 'index'
 
 $map = $configuration['map'] ?? null
 
if(!is_string($default)) if(!is_string($index)) if(!is_array($map)) $this configuration = $configuration
 
$this default = $default
 
$this index = $index
 
$this map = array_map('strval', $map)
 

Protected Member Functions

string resolveValue (?string $type)
 
string buildRegularExpressionPattern (bool $useNames=true)
 
string quoteForRegularExpressionPattern (string $value)
 
bool needsSlashPrefix (string $value)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Routing\Enhancer\AbstractEnhancer
 applyRouteAspects (Route $route, array $aspects, string $namespace=null)
 
 applyRequirements (Route $route, array $requirements, string $namespace=null)
 
array filterValuesByPathVariables (Route $route, array $values)
 
array overrideValuesByAspect (Route $route, array $values, string $targetValue)
 
array defineValuesByAspect (Route $route, array $values, string $targetValue)
 
string modifyRoutePath (string $routePath)
 
string resolveType (Route $route, array &$remainingQueryParameters)
 
VariableProcessor getVariableProcessor ()
 

Protected Attributes

const ROUTE_PATH_DELIMITERS
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Routing\Enhancer\AbstractEnhancer
AspectInterface[] $aspects = array( )
 
VariableProcessor $variableProcessor
 

Detailed Description

Resolves a static list (like page.typeNum) against a file pattern. Usually added on the very last part of the URL. It is important that the PageType Enhancer is executed at the very end in your configuration, as it modifies EXISTING route variants.

routeEnhancers: PageTypeSuffix: type: PageType default: '' index: 'index' map: '.html': 1 'menu.json': 13

Definition at line 38 of file PageTypeDecorator.php.

Member Function Documentation

◆ buildRegularExpressionPattern()

string TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::buildRegularExpressionPattern ( bool  $useNames = true)
protected

◆ decorateForMatching()

TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::decorateForMatching ( RouteCollection  $collection,
string  $routePath 
)

{‪Decorates route collection to be processed during URL resolving. Executed before invoking routing enhancers.

Parameters
RouteCollection$collection
string$routePath‪URL path
}

Implements TYPO3\CMS\Core\Routing\Enhancer\DecoratingEnhancerInterface.

Definition at line 94 of file PageTypeDecorator.php.

References TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\buildRegularExpressionPattern(), TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\map, and TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\quoteForRegularExpressionPattern().

◆ getRoutePathRedecorationPattern()

string TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::getRoutePathRedecorationPattern ( )

◆ needsSlashPrefix()

bool TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::needsSlashPrefix ( string  $value)
protected

Checks if a slash should be prefixed.

Parameters
string$value
Returns
‪bool

Definition at line 244 of file PageTypeDecorator.php.

◆ quoteForRegularExpressionPattern()

string TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::quoteForRegularExpressionPattern ( string  $value)
protected

Helper method for regexps.

Parameters
string$value
Returns
‪string

Definition at line 233 of file PageTypeDecorator.php.

Referenced by TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\buildRegularExpressionPattern(), and TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\decorateForMatching().

◆ resolveValue()

string TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::resolveValue ( ?string  $type)
protected

Checks if the value exists inside the map.

Parameters
string | null$type
Returns
‪string

Definition at line 183 of file PageTypeDecorator.php.

References TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\$index, and TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\map.

Member Data Documentation

◆ $index

TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::$index = $configuration['index'] ?? 'index'

◆ $map

TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::$map = $configuration['map'] ?? null

Definition at line 65 of file PageTypeDecorator.php.

◆ configuration

if (!is_string( $default)) if (!is_string( $index)) if (!is_array( $map)) $this TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::configuration = $configuration

Definition at line 77 of file PageTypeDecorator.php.

◆ default

$this TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::default = $default

Definition at line 78 of file PageTypeDecorator.php.

◆ index

$this TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::index = $index

◆ map

◆ ROUTE_PATH_DELIMITERS

const TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator::ROUTE_PATH_DELIMITERS
protected
Initial value:
= ['.', '-', '_', '/'];
protected array $configuration;
protected string $default;
protected string ‪$index;
protected array ‪$map;
public function __construct(array $configuration)
{
$default = $configuration['default'] ?? ''

Definition at line 40 of file PageTypeDecorator.php.

‪TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\$index
‪$index
Definition: PageTypeDecorator.php:64
‪TYPO3\CMS\Core\Routing\Enhancer\PageTypeDecorator\$map
‪$map
Definition: PageTypeDecorator.php:65