‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper Class Reference
Inheritance diagram for TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper:
TYPO3\CMS\Core\Routing\Aspect\StaticMappableAspectInterface TYPO3\CMS\Core\Routing\Aspect\MappableAspectInterface TYPO3\CMS\Core\Routing\Aspect\AspectInterface

Public Member Functions

 __construct (array $settings)
 
 count ()
 
 generate (string $value)
 
 resolve (string $value)
 

Protected Member Functions

 respondWhenInRange (string $value)
 
string[] buildRange ()
 
string[] applyNumericPrefix (array $range)
 

Protected Attributes

array $settings
 
string $start
 
string $end
 
string[] $range
 

Detailed Description

Very useful for e.g. pagination or static range like "2011 ... 2030" for years.

Example: routeEnhancers: MyBlogPlugin: type: Extbase extension: BlogExample plugin: Pi1 routes:

  • ‪{ routePath: '/list/{paging_widget}', _controller: 'BlogExample::list', _arguments: {'paging_widget': '@widget_0/currentPage'}}
  • ‪{ routePath: '/glossary/{section}', _controller: 'BlogExample::glossary'} defaultController: 'BlogExample::list' requirements: paging_widget: '\d+' aspects: paging_widget: type: StaticRangeMapper start: '1' end: '100' section: type: StaticRangeMapper start: 'a' end: 'z'

Definition at line 45 of file StaticRangeMapper.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ applyNumericPrefix()

string [] TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::applyNumericPrefix ( array  $range)
protected

◆ buildRange()

string [] TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::buildRange ( )
protected

Builds range based on given settings and ensures each item is string. The amount of items is limited to 1000 in order to avoid brute-force scenarios and the risk of cache-flooding.

In case that is not enough, creating a custom and more specific mapper is encouraged. Using high values that are not distinct exposes the site to the risk of cache-flooding.

Returns
‪string[]
Exceptions

Definition at line 128 of file StaticRangeMapper.php.

References TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper\$range, and TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper\count().

Referenced by TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper\__construct().

◆ count()

TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::count ( )

◆ generate()

TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::generate ( string  $value)

◆ resolve()

TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::resolve ( string  $value)

◆ respondWhenInRange()

TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::respondWhenInRange ( string  $value)
protected

Member Data Documentation

◆ $end

string TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::$end
protected

◆ $range

string [] TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::$range
protected

◆ $settings

array TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::$settings
protected

◆ $start

string TYPO3\CMS\Core\Routing\Aspect\StaticRangeMapper::$start
protected