class Twig_Function

Represents a template function.

Methods

__construct(string $name, callable|null $callable = null, array $options = array())

Creates a template function.

getName()

No description

callable|null
getCallable()

Returns the callable to execute for this function.

getNodeClass()

No description

setArguments($arguments)

No description

getArguments()

No description

needsEnvironment()

No description

needsContext()

No description

getSafe(Twig_Node $functionArgs)

No description

isVariadic()

No description

isDeprecated()

No description

getDeprecatedVersion()

No description

getAlternative()

No description

Details

at line 35
__construct(string $name, callable|null $callable = null, array $options = array())

Creates a template function.

Parameters

string $name Name of this function
callable|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation.
array $options Options array

at line 55
getName()

at line 65
callable|null getCallable()

Returns the callable to execute for this function.

Return Value

callable|null

at line 70
getNodeClass()

at line 75
setArguments($arguments)

Parameters

$arguments

at line 80
getArguments()

at line 85
needsEnvironment()

at line 90
needsContext()

at line 95
getSafe(Twig_Node $functionArgs)

Parameters

Twig_Node $functionArgs

at line 108
isVariadic()

at line 113
isDeprecated()

at line 118
getDeprecatedVersion()

at line 123
getAlternative()