Variable ViewHelper <f:variable>
Variable assigning ViewHelper
Assigns one template variable which will exist also after the ViewHelper is done rendering, i.e. adds template variables.
If you require a variable assignment which does not
exist in the template after a piece of Fluid code
is rendered, consider using f: ViewHelper instead.
Usages:
{f:variable(name: 'myvariable', value: 'some value')}
<f:variable name="myvariable">some value</f:variable>
{oldvariable -> f:format.htmlspecialchars() -> f:variable(name: 'newvariable')}
<f:variable name="myvariable"><f:format.htmlspecialchars>{oldvariable}</f:format.htmlspecialchars></f:variable>
Copied!
Go to the source code of this ViewHelper: VariableViewHelper.php (GitHub).
Arguments of the <f:variable> ViewHelper
name
-
- Type
- string
- Required
- 1
Name of variable to create
value
-
- Type
- mixed
Value to assign. If not in arguments then taken from tag content