HumHub Documentation (unofficial)

TwigTest
in package

FinalYes

Represents a template test.

Tags
author

Fabien Potencier fabien@symfony.com

see
https://twig.symfony.com/doc/templates.html#test-operator

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 test.
getDeprecatedVersion()  : string
getName()  : string
getNodeClass()  : string
hasOneMandatoryArgument()  : bool
isDeprecated()  : bool
isVariadic()  : bool
setArguments()  : void

Properties

$arguments

private mixed $arguments = []

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 test. 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|null

getArguments()

public getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCallable()

Returns the callable to execute for this test.

public getCallable() : callable|array{: class-string, : string}|null
Return values
callable|array{: class-string, : string}|null

getDeprecatedVersion()

public getDeprecatedVersion() : string
Return values
string

getName()

public getName() : string
Return values
string

getNodeClass()

public getNodeClass() : string
Return values
string

hasOneMandatoryArgument()

public hasOneMandatoryArgument() : bool
Return values
bool

isDeprecated()

public isDeprecated() : bool
Return values
bool

isVariadic()

public isVariadic() : bool
Return values
bool

setArguments()

public setArguments(array<string|int, mixed> $arguments) : void
Parameters
$arguments : array<string|int, mixed>

        
On this page

Search results