Documentation / Tutorials / Quick Samples

Quick List of conditionals

/ Quick Samples / Quick List of conditionals

[if.equal lhs=<string> rhs=<string>][/if.equal]x
[if.not_equal lhs=<string> rhs=<string>][/if.not_equal]
[if.greater_equal lhs=<string> rhs=<string>][/if.greater_equal]
[if.greater_than lhs=<string> rhs=<string>][/if.greater_than]
[if.less_equal lhs=<string> rhs=<string>][/if.less_equal]
[if.less_than lhs=<string> rhs=<string>][/if.less_than]

[if.whitespace <chain>][/if.whitespace]
[if.not_whitespace <chain>][/if.not_whitespace]

[if.false <chain>][/if.false]
[if.true <chain>][/if.true]

[if.no <chain>][/if.no]
[if.yes <chain>][/if.yes]

[if.not_empty <chain>][/if.not_empty]

[if.odd <chain>][/if.odd]
[if.even <chain>][/if.even]

[if.user_can <string>][/if.user_can]
[if.user_cannot <string>][/if.user_cannot]

[if.logged_in][/if.logged_in]
[if.not_logged_in][/if.not_logged_in]

[if.request <string>][/if.request]
[if.not_request <string>][/if.not_request]

[if.device <string>][/if.device]

datatypes:
[if.arr <chain>][/if.arr]
[if.not_arr <chain>][/if.not_arr]
[if.int <chain>][/if.int]
[if.not_int <chain>][/if.not_int]
[if.str <chain>][/if.str]
[if.not_str <chain>][/if.not_str]
[if.date_obj <chain>][/if.date_obj]
[if.not_date_obj <chain>][/if.not_date_obj]
[if.num <chain>][/if.num]
[if.not_num <chain>][/if.not_num]
[if.obj <chain>][/if.obj]
[if.not_obj <chain>][/if.not_obj]
[if.bool <chain>][/if.bool]
[if.not_bool <chain>][/if.not_bool]

[if.contains needle=<string> haystack=<comma separated string/array>][/if.contains]
[if.not_contains needle=<string> haystack=<comma separated string/array>][/if.not_contains]

and,or,else can be applied to the last ifg

[if.and cond='{module.y}’ equal='{request.a2}’]
we are also equal
[/if.and]

[if.and not_equal={} ]
we are also equal
[/if.and]

[if.or cond='{module.y}’ equal='{request.a2}’]
we are also equal
[/if.or]

[if.or not_equal={} ]
we are also equal
[/if.or]

[if.else][/if.else]

Categories
Most Popular

Leave a Reply

Your email address will not be published. Required fields are marked *