Published on : August 21, 2020
Title : if.bool
Purpose : The Condition to check given variable data type is a Boolean type.
Syntax : [if.bool variable_name]
//** Do something if given variable is a Boolean type **//
[/if.bool]
Input Parameters :
variable_name : The variable name which we want to check that given variable is a Boolean type
Return Value : It return boolean value (true/false)
Example 1 :
Code : [template.isLive = True /]
[if.bool template.isLive]
Given variable is a Boolean type.
[/if.bool]
Output : Given variable is a Boolean type.
Description : In the example, define variable isLive is stored value is a type Boolean, then condition will get satisfied hence logic inside will get executed.
Example 2 :
Code : [template.value_1 = “ABC”/]
[if.bool template.value_1]
Given variable is a Boolean type.
[/if.bool]
Output :
Description : In the example, define variable value 1 stored value is a string type , then the condition will not get satisfied hence logic inside will not get executed.