ConditionMatcher extends AbstractConditionMatcher
Matching TypoScript conditions for frontend disposal.
Used with the TypoScript parser. Matches browserinfo and IP numbers for use with templates.
Table of Contents
Properties
- $context : Context
- $expressionLanguageResolver : Resolver
- $expressionLanguageResolverVariables : array<string|int, mixed>
- $fullRootLine : array<int, array<string, mixed>>
- This is the "full" rootline, identical to TSFE->rootLine: Deepest nested page first, then up until (but not including) pseudo-page 0.
- $pageId : int
- Id of the current page.
- $rootline : array<string|int, mixed>
- The rootline for the current page.
- $simulateMatchConditions : array<string|int, mixed>
- Whether to simulate the behaviour and match specific conditions (used in TypoScript object browser).
- $simulateMatchResult : bool
- Whether to simulate the behaviour and match all conditions (used in TypoScript object browser).
Methods
- __construct() : mixed
- getPageId() : int
- Gets the id of the page to evaluate conditions for.
- getRootline() : array<string|int, mixed>
- Gets the rootline.
- match() : bool
- Matches a TypoScript condition expression.
- setPageId() : mixed
- Sets the id of the page to evaluate conditions for.
- setRootline() : mixed
- Sets the rootline.
- setSimulateMatchConditions() : mixed
- Sets whether to simulate the behaviour and match specific conditions.
- setSimulateMatchResult() : mixed
- Sets whether to simulate the behaviour and match all conditions.
- evaluateExpression() : bool
- initializeExpressionLanguageResolver() : void
- updateExpressionLanguageVariables() : void
Properties
$context
protected
Context
$context
$expressionLanguageResolver
protected
Resolver
$expressionLanguageResolver
$expressionLanguageResolverVariables
protected
array<string|int, mixed>
$expressionLanguageResolverVariables
= []
$fullRootLine
This is the "full" rootline, identical to TSFE->rootLine: Deepest nested page first, then up until (but not including) pseudo-page 0.
protected
array<int, array<string, mixed>>
$fullRootLine
$pageId
Id of the current page.
protected
int
$pageId
$rootline
The rootline for the current page.
protected
array<string|int, mixed>
$rootline
$simulateMatchConditions
Whether to simulate the behaviour and match specific conditions (used in TypoScript object browser).
protected
array<string|int, mixed>
$simulateMatchConditions
= []
$simulateMatchResult
Whether to simulate the behaviour and match all conditions (used in TypoScript object browser).
protected
bool
$simulateMatchResult
= false
Methods
__construct()
public
__construct([Context|null $context = null ][, int|null $pageId = null ][, array<string|int, mixed>|null $rootLine = null ][, array<int, array<string, mixed>>|null $fullRootLine = null ]) : mixed
Parameters
- $context : Context|null = null
-
optional context to fetch data from
- $pageId : int|null = null
- $rootLine : array<string|int, mixed>|null = null
- $fullRootLine : array<int, array<string, mixed>>|null = null
getPageId()
Gets the id of the page to evaluate conditions for.
public
getPageId() : int
Return values
int —Id of the page
getRootline()
Gets the rootline.
public
getRootline() : array<string|int, mixed>
Return values
array<string|int, mixed> —The rootline to be used for matching
match()
Matches a TypoScript condition expression.
public
match(string $expression) : bool
Parameters
- $expression : string
-
The expression to match
Return values
bool —Whether the expression matched
setPageId()
Sets the id of the page to evaluate conditions for.
public
setPageId(int $pageId) : mixed
Parameters
- $pageId : int
-
Id of the page (must be positive)
setRootline()
Sets the rootline.
public
setRootline(array<string|int, mixed> $rootline) : mixed
Parameters
- $rootline : array<string|int, mixed>
-
The rootline to be used for matching (must have elements)
setSimulateMatchConditions()
Sets whether to simulate the behaviour and match specific conditions.
public
setSimulateMatchConditions(array<string|int, mixed> $simulateMatchConditions) : mixed
Parameters
- $simulateMatchConditions : array<string|int, mixed>
-
Conditions to simulate a match for
setSimulateMatchResult()
Sets whether to simulate the behaviour and match all conditions.
public
setSimulateMatchResult(bool $simulateMatchResult) : mixed
Parameters
- $simulateMatchResult : bool
-
Whether to simulate positive matches
evaluateExpression()
protected
evaluateExpression(string $expression) : bool
Parameters
- $expression : string
Return values
boolinitializeExpressionLanguageResolver()
protected
initializeExpressionLanguageResolver() : void
updateExpressionLanguageVariables()
protected
updateExpressionLanguageVariables() : void