Package

ViewHelpers

ViewHelper Documentation

if

This view helper implements an if/else condition.

Conditions:

As a condition is a boolean value, you can just use a boolean argument. Alternatively, you can write a boolean expression there. Boolean expressions have the following form: XX Comparator YY Comparator is one of: ==, !=, <, <=, >, >= and % The % operator converts the result of the % operation to boolean.

XX and YY can be one of:

= Examples =

<f:if condition="somecondition"> This is being shown in case the condition matches </f:if> Everything inside the <f:if> tag is being displayed if the condition evaluates to TRUE.

<f:if condition="somecondition"> <f:then>

This is being shown in case the condition matches.

</f:then> <f:else>

This is being displayed in case the condition evaluates to FALSE.

</f:else> </f:if> Everything inside the "then" tag is displayed if the condition evaluates to TRUE. Otherwise, everything inside the "else"-tag is displayed.

{f:if(condition: someCondition, then: 'condition is met', else: 'condition is not met')} The value of the "then" attribute is displayed if the condition evaluates to TRUE. Otherwise, everything the value of the "else"-attribute is displayed.

Arguments

then anySimpleType, required

Value to be returned if the condition if met.

else anySimpleType, required

Value to be returned if the condition if not met.

condition boolean, required

Condition expression conforming to Fluid boolean rules

ViewHelper Resources

Schema Resources