Fluid
Fluid copied to clipboard
[FEATURE] JoinViewHelper
The JoinViewHelper combines elements from an array into a single string. You can specify both a general separator and a special one for the last element that is rendered between the elements.
Examples
Simple join
<f:join value="{0: '1', 1: '2', 2: '3'}" />
Results in the output:
123
Join with separator
<f:join value="{0: '1', 1: '2', 2: '3'}" separator=", " />
Results in the output:
1, 2, 3
Join with separator, and special one for the last
<f:join value="{0: '1', 1: '2', 2: '3'}" separator=", " separatorLast=" and " />
Results in the output:
1, 2 and 3