StaticRangeMapper
class \
- Implements
- StaticMappableAspectInterface, Countable
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'
Table of Contents
Interfaces
- StaticMappableAspectInterface
- Used for anything that has a fixed list of values mapped against route arguments.
- Countable
Properties
Methods
- __construct() : mixed
- count() : int
- {@inheritdoc}
- generate() : string|null
- resolve() : string|null
- applyNumericPrefix() : string[]
- buildRange() : string[]
- Builds range based on given settings and ensures each item is string.
- respondWhenInRange() : string|null
Properties
$end
protected
string
$end
$range
protected
string[]
$range
$settings
protected
array
$settings
$start
protected
string
$start
Methods
__construct()
public
__construct(array $settings) : mixed
Parameters
- $settings : array
Tags
count()
{@inheritdoc}
public
count() : int
Return values
intgenerate()
public
generate(string $value) : string|null
Parameters
- $value : string
Return values
string|nullresolve()
public
resolve(string $value) : string|null
Parameters
- $value : string
Return values
string|nullapplyNumericPrefix()
protected
applyNumericPrefix(array $range) : string[]
Parameters
- $range : array
Return values
string[]buildRange()
Builds range based on given settings and ensures each item is string.
protected
buildRange() : 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.
Tags
Return values
string[]respondWhenInRange()
protected
respondWhenInRange(string $value) : string|null
Parameters
- $value : string