:navigation-title: constant .. include:: /Includes.rst.txt .. _typo3fluid-fluid-constant: ================================== Constant ViewHelper `` ================================== .. note:: The constant ViewHelper can display **PHP constants** only. It cannot be used to display `TypoScript Constants `_ or `Site settings `_. .. typo3:viewhelper:: constant :source: ../Global.json :display: tags, description, gitHubLink :noindex: .. contents:: Table of contents .. _typo3fluid-fluid-constant-global: Displaying global PHP constants in Fluid ======================================== You can display `global PHP constants `_ using this ViewHelper .. code-block:: html Maximal possible number: {f:constant(name: 'PHP_INT_MAX')} Using PHP 8.0 or greater .. _typo3fluid-fluid-constant-class: Get class constant ================== You can display any **public** class constant from a class within TYPO3, for example constants from :php:`\TYPO3\CMS\Core\Information\Typo3Information`: .. code-block:: html Join the TYPO3 Community ! .. _typo3fluid-fluid-constant-enum: Using enum cases in Fluid ========================= Cases of enums are objects and not strings or integers. They cannot be directly output in the template. You can however save them into a variable and then use their value. For example you can use values of the enum cases in :php:`\TYPO3\CMS\Core\Resource\FileType` to compare them with a value of your object: .. code-block:: html The image case has the value {imageType.value} and name {imageType.name}: This file is an image! .. _typo3fluid-fluid-constant-arguments: Arguments ========= .. typo3:viewhelper:: constant :source: ../Global.json :display: arguments-only