Else ViewHelper <f:else>
Note
This reference is part of the documentation of Fluid Standalone. If you are working with Fluid in TYPO3 CMS, please refer to TYPO3's ViewHelper reference instead.
@see: TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper
Else-Branch of a condition. Only has an effect inside of f:if
.
See the f:if
ViewHelper for documentation.
Examples
Output content if condition is not met
<f:if condition="{someCondition}">
<f:else>
condition was not true
</f:else>
</f:if>
Copied!
Output:
Everything inside the "else" tag is displayed if the condition evaluates to false.
Otherwise, nothing is outputted in this example.
Copied!
Go to the source code of this ViewHelper: ElseViewHelper.php (GitHub).
Arguments
The following arguments are available for the else ViewHelper:
if
-
- Type
- boolean
Condition expression conforming to Fluid boolean rules