Count ViewHelper <f:count>
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.
This ViewHelper counts elements of the specified array or countable object.
Examples
Count array elements
<f:count subject="{0:1, 1:2, 2:3, 3:4}" />
Copied!
Output:
4
Copied!
inline notation
{objects -> f:count()}
Copied!
Output:
10 (depending on the number of items in ``{objects}``)
Copied!
Go to the source code of this ViewHelper: CountViewHelper.php (GitHub).
Arguments
The following arguments are available for the count ViewHelper:
subject
-
- Type
- array
Countable subject, array or \Countable