Executes the default case if non of the conditiion is satisfied
Syntax
:
[aw2.switch]
[aw2.case cond='{request.x}’ equal=’1′]
x is equal to 1
[/aw2.case]
[aw2.case cond='{request.x}’ equal=’2′]
x is equal to 1
[/aw2.case]
[aw2.case_else]
x is not equal to 1 or 2
[/aw2.case_else]
[/aw2.switch]
Input Parameters
:
Not required
Return Value
:
It does not return anything
Example
:
Code
:
XHTML
1
2
3
4
5
6
7
8
9
10
11
12
[template.settestvar='1']
[aw2.switch]
[aw2.casecond='{template.testvar}'equal='1']
testvarisequalto1
[/aw2.case]
[aw2.casecond='{template.testvar}'equal='2']
testvarisequalto1
[/aw2.case]
[aw2.case_else]
testvarisnotequalto1or2
[/aw2.case_else]
[/aw2.switch]
Description
:
In the example, if the the value of testvar is ‘1’, then it executes the code in the first block. If none of the condition is satisfied then it executes the last block that is default block