Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Count ViewHelper <f:count>
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!
Source code
Go to the source code of this ViewHelper: CountViewHelper.php (GitHub).
Arguments
The following arguments are available for <f:
:
subject
-
- Type
- mixed
Countable subject, array or Countable