Documentation

NameExpression extends AbstractExpression
in package
implements SupportDefinedTestInterface uses SupportDefinedTestDeprecationTrait, SupportDefinedTestTrait

Abstract class for all nodes that represents an expression.

Table of Contents

Interfaces

SupportDefinedTestInterface
Interface implemented by expressions that support the defined test.

Properties

$attributes  : mixed
$lineno  : mixed
$nodes  : array<string|int, Node>
$tag  : mixed
$definedTest  : bool
$specialVars  : mixed

Methods

__clone()  : mixed
__construct()  : mixed
__toString()  : string
compile()  : void
count()  : int
deprecateAttribute()  : void
deprecateNode()  : void
enableDefinedTest()  : void
getAttribute()  : mixed
getIterator()  : Traversable
getNode()  : self
getNodeTag()  : string|null
getSourceContext()  : Source|null
getTemplateLine()  : int
getTemplateName()  : string|null
hasAttribute()  : bool
hasExplicitParentheses()  : bool
hasNode()  : bool
isDefinedTestEnabled()  : bool
isGenerator()  : bool
isSimple()  : mixed
isSpecial()  : mixed
removeAttribute()  : void
removeNode()  : void
setAttribute()  : void
setExplicitParentheses()  : static
setNode()  : void
setSourceContext()  : void

Properties

$attributes

protected mixed $attributes

$lineno

protected mixed $lineno

$nodes

protected array<string|int, Node> $nodes

$tag

protected mixed $tag

$specialVars

private mixed $specialVars = ['_self' => '$this->getTemplateName()', '_context' => '$context', '_charset' => '$this->env->getCharset()']

Methods

__clone()

public __clone() : mixed

__construct()

public __construct(string $name, int $lineno) : mixed
Parameters
$name : string
$lineno : int

The line number

__toString()

public __toString() : string
Return values
string

count()

public count() : int
Attributes
#[ReturnTypeWillChange]
Return values
int

getAttribute()

public getAttribute(string $name) : mixed
Parameters
$name : string

getIterator()

public getIterator() : Traversable
Return values
Traversable

getNode()

public getNode(string|int $name) : self
Parameters
$name : string|int
Return values
self

getNodeTag()

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

getSourceContext()

public getSourceContext() : Source|null
Return values
Source|null

getTemplateLine()

public getTemplateLine() : int
Return values
int

getTemplateName()

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

hasAttribute()

public hasAttribute(string $name) : bool
Parameters
$name : string
Return values
bool

hasExplicitParentheses()

public hasExplicitParentheses() : bool
Return values
bool

hasNode()

public hasNode(string|int $name) : bool
Parameters
$name : string|int
Return values
bool

isSimple()

public isSimple() : mixed

since Twig 3.11 (to be removed in 4.0)

isSpecial()

public isSpecial() : mixed

since Twig 3.11 (to be removed in 4.0)

removeAttribute()

public removeAttribute(string $name) : void
Parameters
$name : string

removeNode()

public removeNode(string|int $name) : void
Parameters
$name : string|int

setAttribute()

public setAttribute(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

setExplicitParentheses()

public setExplicitParentheses() : static
Return values
static

setNode()

public setNode(string|int $name, self $node) : void
Parameters
$name : string|int
$node : self

setSourceContext()

public setSourceContext(Source $source) : void
Parameters
$source : Source

        
On this page

Search results