ConditionMatcher

class \TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\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
$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
The rootline for the current page.
$simulateMatchConditions  : array
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
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

$expressionLanguageResolverVariables

protected array $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 $rootline

$simulateMatchConditions

Whether to simulate the behaviour and match specific conditions (used in TypoScript object browser).

protected array $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|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|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

Return values

array —

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 $rootline) : mixed

Parameters

$rootline : array

The rootline to be used for matching (must have elements)

setSimulateMatchConditions()

Sets whether to simulate the behaviour and match specific conditions.

public setSimulateMatchConditions(array $simulateMatchConditions) : mixed

Parameters

$simulateMatchConditions : array

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

bool

initializeExpressionLanguageResolver()

protected initializeExpressionLanguageResolver() : void

updateExpressionLanguageVariables()

protected updateExpressionLanguageVariables() : void
On this page