Conditionals
All conditional helpers that evaluate a condition and return a boolean value. Conditional helpers can be used in inline as well as in block format.
#and
Truthy AND check for multiple values.
Multiple values:
Inline form:
#contains
Returns true if the context as string contains the first parameter as string; otherwise returns false.
Inline form:
Block form:
See the similar XPath 1.0 function.
This implementation also supports collections, arrays, and maps. For collections and arrays it will return true if the collection contains the parameter. For maps, it will return true if the map contains the parameter as a key. In all cases type (string, number, boolean, etc.) and value must match.
To make it XPath-strict, please use as {{contains x string(y)}}
#endsWith
Returns true if the context as string ends with the first parameter as string; otherwise returns false.
Inline form:
Block form:
#eq
Tests equality.
Inline form:
#gt
Greater than. Values must be comparable.
Inline form:
#gte
Greater than or equal.
Inline form:
#lt
Less than.
Inline form:
#lte
Less than or equal.
Inline form:
#matches
Similar to #if but using a regular expression for evaluation. It has two options
safe: if it is set tofalse, exeption will be thrown (usefull during development/debugging). Default istruefallback: iffallback="true", even the evaluation is false, the result still returntrue.
Block form:
Inline form:
If safe=false
Using fallback
Even though regex is invalid "[", result is true.
#neq
Tests inequality.
Inline form:
#not
Negates truthiness.
Inline form:
#or
Truthy OR check for multiple values.
Inline form:
#startsWith
Returns true if the context as string starts with the first parameter as string; otherwise returns false.
Inline form:
Block form:
See the similar XPath 1.0 function.