LinkVarsCalculator

Class to calculate so-called "linkVars", which is a TypoScript setting to always append these query parameters (if available in an existing request) to a URL when using TypoLink for pages.

Table of Contents

Methods

getAllowedLinkVarsFromRequest()  : string
Calculates and sets the internal linkVars based upon the current request's GET parameters and the setting "config.linkVars".
isAllowedLinkVarValue()  : bool
Checks if the value defined in "config.linkVars" contains an allowed value.
splitLinkVarsString()  : array<string|int, mixed>
Split the link vars string by "," but not if the "," is inside of braces

Methods

getAllowedLinkVarsFromRequest()

Calculates and sets the internal linkVars based upon the current request's GET parameters and the setting "config.linkVars".

public getAllowedLinkVarsFromRequest(string $linkVarsSetting, array<string|int, mixed> $queryParams, Context $context) : string
Parameters
$linkVarsSetting : string
$queryParams : array<string|int, mixed>
$context : Context
Return values
string

isAllowedLinkVarValue()

Checks if the value defined in "config.linkVars" contains an allowed value.

protected isAllowedLinkVarValue(string $haystack, string $value) : bool

Otherwise, return FALSE which means the value will not be added to any links.

Parameters
$haystack : string

The string in which to find $value

$value : string

The string to find in $haystack

Return values
bool

Returns TRUE if $value matches or is found in $haystack

splitLinkVarsString()

Split the link vars string by "," but not if the "," is inside of braces

protected splitLinkVarsString(string $string) : array<string|int, mixed>
Parameters
$string : string
Return values
array<string|int, mixed>

        
On this page

Search results