if.or
/
Conditionals /
if.or
By Amit Singh. Posted on
Title |
: |
if.or |
Purpose |
: |
For executing a certain code block when either one of the multiple conditions becomes true. |
Syntax |
: |
|
[if.or cond="VALUE1" equal="VALUE2"]//*** I WILL EXECUTE ***//[/if.or] |
|
Input Parameters |
: |
cond: (Required) Condition to compare
equal: (Required) The value which needs to be equal to the condition
not_equal: (Required – either equal or not_equal)
The value which should not be equal to the condition |
Return Value |
: |
(void) It won’t return anything, instead it will execute the codes when the condition becomes true. |
Example 1 |
: |
Code |
: |
|
[templates.add main] [template.set fuel="1" /] [template.set key="0" /] [template.set sensor="1" /] [if.equal lhs="{template.fuel}" rhs="1"] Hello, [/if.equal] [if.equal lhs="{template.key}" rhs="1"][/if.equal] [if.or cond="{template.sensor}" equal="1"] Start your engine [/if.or] [if.else] You need key or sensor to start your engine. [/if.else] [/templates.add] |
|
Output |
: |
It will display the text “Hello, Start your engine” when either fuel
or key is present. |
Description |
: |
In this example we are displaying a text when either one of the two conditions becomes true. |
|
Last Modified By Sooraj Raju.