Javascript and PHP | Awesome Shortcode | ||||||||
———————————————————
|
Note: If provided variable is number then executes ———————————————————
Note: If provided variable is not number then executes |
||||||||
———————————————————
|
Note: If provided variable is int then executes ———————————————————
Note: If provided variable is not int then executes |
||||||||
———————————————————
|
———————————————————
Note: If provided variable is return false or true then executes Examples are explained below |
||||||||
———————————————————
|
Note: If provided variable is string then executes ———————————————————
Note: If provided variable is not string then executes |
||||||||
———————————————————
|
Note: If provided variable is array then executes ———————————————————
Note: If provided variable is not array then executes |
||||||||
———————————————————
|
Note: If provided variable is boolean then executes ———————————————————
Note: If provided variable is not boolean then executes |
||||||||
———————————————————
|
Note: If provided variable is obj then executes ———————————————————
Note: If provided variable is not obj then executes |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[template.set_array arr_var value="any value" /] //** is_array returns boolean true or false value **// [php.is_array p1="{template.arr_var}" set="template.array_result" /] array_result contains boolean true/false value so not need curly braces around it to check with if.true if.true {..variable..} => WITHOUT curly braces [if.true template.array_result] [template.get array_result dump=t /] [/if.true] -------------------------------- [template.set var_fa="false" /] FALSE value is string, need to put in the curly braces to check with if.false then compare as bool if.false {..variable..} => WITH curly braces [if.false {template.var_fa}] [aw2.get template.var_fa dump=t /] [/if.false] -------------------------------- FALSE value is string, if not added in curly braces to check with if.false, its not comparable as bool [template.set var_fa="false" /] if.false {..variable..} => WITHOUT curly braces [if.false template.var_fa] [aw2.get template.var_fa dump=t /] [/if.false] -------------------------------- [template.set var_tr="true" /] if.true {..variable..} => WITH curly braces [if.false {template.var_tr}] [aw2.get template.var_tr dump=t /] [/if.false] -------------------------------- |