\Twig\Node\Expression\TestConstantTest

Checks if a variable is the exact same value as a constant.

 {% if post.status is constant('Post::PUBLISHED') %}
   the status attribute is exactly the same as Post::PUBLISHED
 {% endif %}

Summary

Methods
Properties
Constants
compile()
__construct()
__toString()
getTemplateLine()
getNodeTag()
hasAttribute()
getAttribute()
setAttribute()
removeAttribute()
hasNode()
getNode()
setNode()
removeNode()
count()
getIterator()
setTemplateName()
getTemplateName()
No public properties found
No constants found
compileCallable()
compileArguments()
getArguments()
normalizeName()
$nodes
$attributes
$lineno
$tag
N/A
getCallableParameters()
reflectCallable()
$reflector
$name
N/A

Properties

$nodes

$nodes : 

Type

$attributes

$attributes : 

Type

$lineno

$lineno : 

Type

$tag

$tag : 

Type

$reflector

$reflector : 

Type

$name

$name : 

Type

Methods

compile()

compile(\Twig_Compiler  $compiler) 

Parameters

\Twig_Compiler $compiler

__construct()

__construct(array  $nodes = array(), array  $attributes = array(), integer  $lineno, string  $tag = null) 

Constructor.

The nodes are automatically made available as properties ($this->node). The attributes are automatically made available as array items ($this['name']).

Parameters

array $nodes

An array of named nodes

array $attributes

An array of attributes (should not be nodes)

integer $lineno

The line number

string $tag

The tag name associated with the Node

__toString()

__toString() 

getTemplateLine()

getTemplateLine() 

getNodeTag()

getNodeTag() 

hasAttribute()

hasAttribute(  $name) : boolean

Parameters

$name

Returns

boolean

getAttribute()

getAttribute(  $name) : mixed

Parameters

$name

Returns

mixed

setAttribute()

setAttribute(string  $name, mixed  $value) 

Parameters

string $name
mixed $value

removeAttribute()

removeAttribute(  $name) 

Parameters

$name

hasNode()

hasNode(  $name) : boolean

Parameters

$name

Returns

boolean

getNode()

getNode(  $name) : \Twig_Node

Parameters

$name

Returns

\Twig_Node

setNode()

setNode(  $name, self  $node) 

Parameters

$name
self $node

removeNode()

removeNode(  $name) 

Parameters

$name

count()

count() 

getIterator()

getIterator() 

setTemplateName()

setTemplateName(  $name) 

Parameters

$name

getTemplateName()

getTemplateName() 

compileCallable()

compileCallable(\Twig_Compiler  $compiler) 

Parameters

\Twig_Compiler $compiler

compileArguments()

compileArguments(\Twig_Compiler  $compiler,   $isArray = false) 

Parameters

\Twig_Compiler $compiler
$isArray

getArguments()

getArguments(  $callable = null,   $arguments) 

Parameters

$callable
$arguments

normalizeName()

normalizeName(  $name) 

Parameters

$name

getCallableParameters()

getCallableParameters(  $callable,   $isVariadic) 

Parameters

$callable
$isVariadic

reflectCallable()

reflectCallable(  $callable) 

Parameters

$callable