Feature ViewHelper <f:feature> 

ViewHelper to check if a feature flag is enabled, implemented as a condition like an "if" construct.

Go to the source code of this ViewHelper: FeatureViewHelper.php (GitHub).

Examples 

Basic usage 

packages/my_extension/Resources/Private/Templates/Blog/List.fluid.html
<f:feature name="myFeatureFlag">
  This is being shown if the flag is enabled
</f:feature>
Copied!

Feature / then / else 

packages/my_extension/Resources/Private/Templates/Blog/List.fluid.html
<f:feature name="myFeatureFlag">
  <f:then>
    Flag is enabled
  </f:then>
  <f:else>
    Flag is undefined or not enabled
  </f:else>
</f:feature>
Copied!

Arguments of the <f:feature> ViewHelper 

else

else
Type
mixed
Value to be returned if the condition if not met.

name

name
Type
string
Required
1
name of the feature flag that should be checked

then

then
Type
mixed
Value to be returned if the condition if met.