TwigFunction
in package
FinalYes
Represents a template function.
Tags
Table of Contents
Properties
- $arguments : mixed
- $callable : mixed
- $name : mixed
- $options : mixed
Methods
- __construct() : mixed
- getAlternative() : string|null
- getArguments() : array<string|int, mixed>
- getCallable() : callable|array{: class-string, : string}|null
- Returns the callable to execute for this function.
- getDeprecatedVersion() : string
- getName() : string
- getNodeClass() : string
- getSafe() : array<string|int, mixed>|null
- isDeprecated() : bool
- isVariadic() : bool
- needsCharset() : bool
- needsContext() : bool
- needsEnvironment() : bool
- setArguments() : void
Properties
$arguments
private
mixed
$arguments
= []
$callable
private
mixed
$callable
$name
private
mixed
$name
$options
private
mixed
$options
Methods
__construct()
public
__construct(string $name[, callable|array{: class-string, : string}|null $callable = null ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $name : string
- $callable : callable|array{: class-string, : string}|null = null
-
A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation.
- $options : array<string|int, mixed> = []
getAlternative()
public
getAlternative() : string|null
Return values
string|nullgetArguments()
public
getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>getCallable()
Returns the callable to execute for this function.
public
getCallable() : callable|array{: class-string, : string}|null
Return values
callable|array{: class-string, : string}|nullgetDeprecatedVersion()
public
getDeprecatedVersion() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetNodeClass()
public
getNodeClass() : string
Return values
stringgetSafe()
public
getSafe(Node $functionArgs) : array<string|int, mixed>|null
Parameters
- $functionArgs : Node
Return values
array<string|int, mixed>|nullisDeprecated()
public
isDeprecated() : bool
Return values
boolisVariadic()
public
isVariadic() : bool
Return values
boolneedsCharset()
public
needsCharset() : bool
Return values
boolneedsContext()
public
needsContext() : bool
Return values
boolneedsEnvironment()
public
needsEnvironment() : bool
Return values
boolsetArguments()
public
setArguments(array<string|int, mixed> $arguments) : void
Parameters
- $arguments : array<string|int, mixed>