Classes, interfaces and traits

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

« More »

DivisiblebyTest

Checks if a variable is divisible by a number.

{% if loop.index is divisible by(3) %}

« More »

EvenTest

Checks if a number is even.

{{ var is even }}

« More »

NullTest

Checks that a variable is null.

{{ var is none }}

« More »

OddTest

Checks if a number is odd.

{{ var is odd }}

« More »

SameasTest

Checks if a variable is the same as another one (=== in PHP).

« More »