if.and
/
Conditionals /
if.and
By Amit Singh. Posted on
Title |
: |
if.and |
Purpose |
: |
For executing a certain code block when multiple conditions becomes true. |
Syntax |
: |
|
[if.and cond="VALUE1" equal="VALUE2"] //*** I WILL EXECUTE ***// [/if.and] |
|
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="1" /] [if.equal lhs="{template.fuel}" rhs="1"] [/if.equal] [if.and cond="{template.key}" equal="1"] Hello, Start your engine [/if.and] [if.else] Please insert your key. [/if.else] [/templates.add] |
|
Output |
: |
It will display the text “Hello, Start your engine” when both fuel
and key is present. |
Description |
: |
In this example we are displaying a text when two conditions
becomes true. |
|
Last Modified By Sooraj Raju.