Length ViewHelper <f:length>
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.
The LengthViewHelper returns the length of a given string. Setting the character encoding is optional.
Examples
Simple example
<f:length value="Hello, World!" />
Copied!
Output:
13
Copied!
Example with encoding
<f:length value="Hello, World!" encoding="UTF-8" />
Copied!
Output:
13
Copied!
For supported character encodings see https://www.php.net/manual/en/mbstring.supported-encodings.php
Inline notation
{f:length(value: 'Hello, World!')}
Copied!
Output:
13
Copied!
Go to the source code of this ViewHelper: LengthViewHelper.php (GitHub).
Arguments
The following arguments are available for the length ViewHelper:
encoding
-
- Type
- string
Character encoding
value
-
- Type
- mixed
An string