ZPT-JS reference - Comparison expressions

Syntax

comparison_expressions ::= ( 'eq:' | 'gt:' | 'lt:' | 'in:' ) expression expression [ expression ]*
                

Description

The available comparison expressions are:

All operators uses lazy evaluation. All expressions support 2 or more operators. Parenthesis can be used.

Differences with ZPT

This expressions does not exist in ZPT.

Examples

Some examples in data-condition:

<p data-condition="eq: assets liabilities anObject">
    true if assets, liabilities and anObject are all equals
</p>
<p data-condition="gt: 10 ( +: children pets )">
    true if 10 > ( children + pets)
</p>
<p data-condition="lt: 10 ( +: children pets )">
    true if 10 < ( children + pets)
</p>
<p data-condition="in: value 'option1' 'option2' 'option3'">
    true if value is 'option1', 'option2' or 'option3'
</p>
<p data-condition="in: value array">
    true if value is an item of array
</p>
<p data-condition="in: value 'option1' 'option2' array">
    true if value is 'option1', 'option2' or an item of array
</p>