Constant ViewHelper <f:constant>
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.
Wrapper for PHPs constant
function.
See https://www.php.net/manual/function.constant.php.
Examples
Get built-in PHP constant
{f:constant(name: 'PHP_INT_MAX')}
Copied!
Output:
9223372036854775807
(Depending on CPU architecture).
Copied!
Get class constant
{f:constant(name: '\Vendor\Package\Class::CONSTANT')}
Copied!
Get enum case
{f:constant(name: '\Vendor\Package\Enum::CASE')}
Copied!
Go to the source code of this ViewHelper: ConstantViewHelper.php (GitHub).
Arguments
The following arguments are available for the constant ViewHelper:
name
-
- Type
- string
String representation of a PHP constant or enum