Twig_Node_Expression_Test_Constant

Extends\Twig\Node\Expression\Test\ConstantTest

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 %}

package

Default

Methods

compile

compile(\Twig\Compiler $compiler)
inherited

Arguments

$compiler

\Twig\Compiler