is
Reports whether the value equals any one of the given candidates, a compact way to write an 'is this one of these' test in a template.
Comparison is exact on type, so the number 5 does not match the string "5".
InputArgumentsReturns
Sourceany...anyboolBasicSource
Reports whether the value equals any one of the given candidates.
Given
{"status": "pending"}Template
{{ status | is:'active','pending' }}Result
trueNo matchSource
Returns false when the value equals none of the candidates.
Given
{"status": "archived"}Template
{{ status | is:'active','pending' }}Result
falseSingleSource
Tests the value against a single candidate.
Given
{"role": "admin"}Template
{{ role | is:'admin' }}Result
true