ConstantTest

Extends\Twig\Node\Expression\TestExpression

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

author

Fabien Potencier fabien@symfony.com

package

Default

Methods

compile

compile(\Twig\Compiler $compiler)

Arguments

$compiler

\Twig\Compiler