join ViewHelper <f:join>

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, which serves as the delimiter between the elements.

Examples

Simple join

<f:join value="{0: '1', 1: '2', 2: '3'}" />
Copied!
123
Copied!

Join with separator

<f:join value="{0: '1', 1: '2', 2: '3'}" separator=", " />
Copied!
1, 2, 3
Copied!

Join with separator, and special one for the last

<f:join value="{0: '1', 1: '2', 2: '3'}" separator=", " separatorLast=" and " />
Copied!
1, 2 and 3
Copied!

Arguments

value

DataType
mixed
Required
false
Description
An array

separator

DataType
string
Required
false
Description
The separator

separatorLast

DataType
string
Required
false
Description
The separator for the last pair.