Twig API
Class

Twig_Node_Expression_Test_Constant

class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test

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

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

Methods

__construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno)

from Twig_Node_Expression_Test
compile(Twig_Compiler $compiler)

Details

public __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno)

Parameters

Twig_NodeInterface $node
$name
Twig_NodeInterface $arguments
$lineno

at line 25
public compile(Twig_Compiler $compiler)

Parameters

Twig_Compiler $compiler