Feature ViewHelper <f:feature>

This ViewHelper checks if a feature flag is enabled

Examples

Basic usage

<f:feature name="myFeatureFlag">
   This is being shown if the flag is enabled
</f:feature>
Copied!

feature / then / else

<f:feature name="myFeatureFlag">
   <f:then>
      Flag is enabled
   </f:then>
   <f:else>
      Flag is undefined or not enabled
   </f:else>
</f:feature>
Copied!

Source code

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

Arguments

The following arguments are available for the 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.