Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 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 v12 here: TYPO3 ELTS.
Split ViewHelper <f:split>
The SplitViewHelper splits a string by the specified separator, which results in an array. The number of values in the resulting array can be limited with the limit parameter, which results in an array where the last item contains the remaining unsplit string.
This ViewHelper mimicks PHP's
explode function.
Examples
Split with a separator
<f:split value="1,5,8" separator="," />
{0: '1', 1: '5', 2: '8'}
Split using tag content as value
<f:split separator="-">1-5-8</f:split>
{0: '1', 1: '5', 2: '8'}
Split with a limit
<f:split value="1,5,8" separator="," limit="2" />
{0: '1', 1: '5,8'}
Go to the source code of this ViewHelper: SplitViewHelper.php (GitHub).
Arguments
The following arguments are available for the split ViewHelper:
limit
-
- Type
- int
- Default
- 9223372036854775807
If limit is positive, a maximum of $limit items will be returned. If limit is negative, all items except for the last $limit items will be returned. 0 will be treated as 1.
separator
-
- Type
- string
- Required
- 1
Separator string to explode with
value
-
- Type
- string
The string to explode