Slot ViewHelper <f:slot>
f: allows a template that is called as a component to access and render
the child content of the calling component tag. This makes nesting of components
possible.
Most importantly, the f: ViewHelper makes sure that the right level of
HTML escaping happens automatically, in line with the escaping in other parts of
Fluid: If HTML is used directly, it is not escaped. However, if a variable is
used within the child content that contains a HTML string, that HTML is escaped
because it might be from an unknown source.
In combination with the <f:fragment> ViewHelper, multiple slots can be used in one component.
If a slot is defined, this ViewHelper will always attempt to return a string,
regardless of the original type of the content. If a slot is not defined, the
ViewHelper will return null.
Go to the source code of this ViewHelper: SlotViewHelper.php (GitHub).
Arguments of the <f:slot> ViewHelper
name
-
- Type
- string
- Default
- 'default'
Name of the slot, can be omitted for default slot