‪TYPO3CMS  9.5
TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor Class Reference

Public Member Functions

string deflateRoutePath (string $routePath, string $namespace=null, array $arguments=[])
 
string inflateRoutePath (string $routePath, string $namespace=null, array $arguments=[])
 
array deflateNamespaceParameters (array $parameters, string $namespace, array $arguments=[])
 
array inflateNamespaceParameters (array $parameters, string $namespace, array $arguments=[])
 
array deflateParameters (array $parameters, array $arguments=[])
 
array inflateParameters (array $parameters, array $arguments=[])
 
array deflateKeys (array $items, string $namespace=null, array $arguments=[], bool $hash=true)
 
array inflateKeys (array $items, string $namespace=null, array $arguments=[], bool $hash=true)
 

Protected Member Functions

string addHash (string $value)
 
string resolveHash (string $hash)
 
string addNestedValue (string $value)
 
string resolveNestedValue (string $value)
 
array deflateValues (array $values, string $namespace=null, array $arguments=[], bool $hash=true)
 
array inflateValues (array $values, string $namespace=null, array $arguments=[], bool $hash=true)
 
array deflateArray (array $array, string $prefix='')
 
array inflateArray (array $array, ?string $namespace, array $arguments)
 
string inflateNestedValue (string $value, ?string $namespace, array $arguments)
 

Protected Attributes

const LEVEL_DELIMITER = '__'
 
const ARGUMENT_SEPARATOR = '/'
 
const VARIABLE_PATTERN = '#\{(?P<modifier>!)?(?P<name>[^}]+)\}#'
 
array $hashes = array( )
 
array $nestedValues = array( )
 

Detailed Description

Helper for processing various variables within a Route Enhancer

Definition at line 22 of file VariableProcessor.php.

Member Function Documentation

◆ addHash()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::addHash ( string  $value)
protected

◆ addNestedValue()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::addNestedValue ( string  $value)
protected
Parameters
string$value
Returns
‪string

Definition at line 82 of file VariableProcessor.php.

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateValues().

◆ deflateArray()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::deflateArray ( array  $array,
string  $prefix = '' 
)
protected

Deflates (flattens) array having nested structures.

Parameters
array$array
string$prefix
Returns
‪array

Definition at line 335 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\addHash().

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateNamespaceParameters(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateParameters().

◆ deflateKeys()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::deflateKeys ( array  $items,
string  $namespace = null,
array  $arguments = [],
bool  $hash = true 
)

◆ deflateNamespaceParameters()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::deflateNamespaceParameters ( array  $parameters,
string  $namespace,
array  $arguments = [] 
)

Deflates (flattens) route/request parameters for a given namespace.

Parameters
array$parameters
string$namespace
array$arguments
Returns
‪array

Definition at line 160 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateArray(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateKeys().

Referenced by TYPO3\CMS\Core\Routing\Enhancer\PluginEnhancer\deflateParameters().

◆ deflateParameters()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::deflateParameters ( array  $parameters,
array  $arguments = [] 
)

Deflates (flattens) route/request parameters for a given namespace.

Parameters
array$parameters
array$arguments
Returns
‪array

Definition at line 203 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateArray(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateKeys().

Referenced by TYPO3\CMS\Core\Routing\Enhancer\SimpleEnhancer\enhanceForGeneration().

◆ deflateRoutePath()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::deflateRoutePath ( string  $routePath,
string  $namespace = null,
array  $arguments = [] 
)

◆ deflateValues()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::deflateValues ( array  $values,
string  $namespace = null,
array  $arguments = [],
bool  $hash = true 
)
protected

Deflates plain values.

Parameters
array$values
string | null$namespace
array$arguments
bool$hash
Returns
‪array

Definition at line 275 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\addHash(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\addNestedValue().

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateKeys(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\deflateRoutePath().

◆ inflateArray()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateArray ( array  $array,
?string  $namespace,
array  $arguments 
)
protected

◆ inflateKeys()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateKeys ( array  $items,
string  $namespace = null,
array  $arguments = [],
bool  $hash = true 
)

Inflates keys names on the first level, now recursion into sub-arrays. Can be used to adjust key names of route requirements, mappers, etc.

Parameters
array$items
string | null$namespace
array$arguments
bool$hash‪= true
Returns
‪array

Definition at line 254 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateValues().

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateNamespaceParameters(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateParameters().

◆ inflateNamespaceParameters()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateNamespaceParameters ( array  $parameters,
string  $namespace,
array  $arguments = [] 
)

◆ inflateNestedValue()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateNestedValue ( string  $value,
?string  $namespace,
array  $arguments 
)
protected
Parameters
string$value
string$namespace
array$arguments
Returns
‪string

Definition at line 392 of file VariableProcessor.php.

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateArray().

◆ inflateParameters()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateParameters ( array  $parameters,
array  $arguments = [] 
)

Inflates (unflattens) route/request parameters.

Parameters
array$parameters
array$arguments
Returns
‪array

Definition at line 216 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateArray(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateKeys().

Referenced by TYPO3\CMS\Core\Routing\Enhancer\SimpleEnhancer\inflateParameters().

◆ inflateRoutePath()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateRoutePath ( string  $routePath,
string  $namespace = null,
array  $arguments = [] 
)
Parameters
string$routePath
string | null$namespace
array$arguments
Returns
‪string

Definition at line 136 of file VariableProcessor.php.

References TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateValues().

◆ inflateValues()

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::inflateValues ( array  $values,
string  $namespace = null,
array  $arguments = [],
bool  $hash = true 
)
protected

◆ resolveHash()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::resolveHash ( string  $hash)
protected
Parameters
string$hash
Returns
‪string
Exceptions

Definition at line 64 of file VariableProcessor.php.

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateArray(), and TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateValues().

◆ resolveNestedValue()

string TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::resolveNestedValue ( string  $value)
protected
Parameters
string$value
Returns
‪string

Definition at line 100 of file VariableProcessor.php.

Referenced by TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor\inflateValues().

Member Data Documentation

◆ $hashes

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::$hashes = array( )
protected

Definition at line 30 of file VariableProcessor.php.

◆ $nestedValues

array TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::$nestedValues = array( )
protected

Definition at line 34 of file VariableProcessor.php.

◆ ARGUMENT_SEPARATOR

const TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::ARGUMENT_SEPARATOR = '/'
protected

Definition at line 25 of file VariableProcessor.php.

◆ LEVEL_DELIMITER

const TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::LEVEL_DELIMITER = '__'
protected

Definition at line 24 of file VariableProcessor.php.

◆ VARIABLE_PATTERN

const TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor::VARIABLE_PATTERN = '#\{(?P<modifier>!)?(?P<name>[^}]+)\}#'
protected

Definition at line 26 of file VariableProcessor.php.