EvaluateModifierFunctionEvent

FinalYes

Listeners to this event are able to implement own ":=" TypoScript modifier functions, example:

foo = myOriginalValue foo := myNewFunction(myFunctionArgument)

Listeners should take care function names can not overlap with function names from other extensions and should thus namespace, example naming: "extNewsSortFunction()"

Table of Contents

Methods

__construct()  : mixed
getFunctionArgument()  : string
Optional function argument, for example "myArgument" when using "foo := extNewsSortFunction(myArgument)" If the argument contained constants, those have been resolved at this point.
getFunctionName()  : string
The function name, for example "extNewsSortFunction" when using "foo := extNewsSortFunction()"
getOriginalValue()  : string|null
Original / current value, for example "fooValue" when using: foo = fooValue foo := extNewsSortFunction(myArgument)
getValue()  : string|null
Used by AstBuilder to fetch the updated value, falls back to given original value.
setValue()  : void
Set the updated value calculated by a listener.

Methods

__construct()

public __construct(string $functionName, string $functionArgument, string|null $originalValue) : mixed
Parameters
$functionName : string
$functionArgument : string
$originalValue : string|null

getFunctionArgument()

Optional function argument, for example "myArgument" when using "foo := extNewsSortFunction(myArgument)" If the argument contained constants, those have been resolved at this point.

public getFunctionArgument() : string
Return values
string

getFunctionName()

The function name, for example "extNewsSortFunction" when using "foo := extNewsSortFunction()"

public getFunctionName() : string
Return values
string

getOriginalValue()

Original / current value, for example "fooValue" when using: foo = fooValue foo := extNewsSortFunction(myArgument)

public getOriginalValue() : string|null
Return values
string|null

getValue()

Used by AstBuilder to fetch the updated value, falls back to given original value.

public getValue() : string|null

Can be used by Listeners to see if a previous listener changed the value already by comparing with getOriginalValue().

Return values
string|null

setValue()

Set the updated value calculated by a listener.

public setValue(string $value) : void

Note you can not set to null to "unset", since getValue() falls back to originalValue in this case. Set to empty string instead for this edge case.

Parameters
$value : string

        
On this page

Search results