Zum Hauptinhalt springen

Concatenate array

Anatomy

<array:concat var="var" var_result="(destructive on 'var')" var_tail="var"/>

Description: ARRAY:CONCAT concatenates the items of the tail array to an array.

ARRAY:CONCAT will implicitly generate a consecutive numeric key for each item of the tail array.

Attention:

ARRAY:CONCAT is destructive, in the sense that it modifies the array in-place, unless 'var_result' is specified in which case a copy of the resulting array will be stored in 'var_result' instead. It preserves the key and value associations of the array.

Attributes

NameTypeDescriptionDefined By
varvarVariable name array:concat
var_resultvarResult variable name array:concat
var_tailvarTail variable name array:concat

Results:

BindingTypePredicate
varvar_resultarray

Examples

Example

<array var="names">
<item>Bill Gates</item>
</array>

<array var="addition">
<item>Steve Jobs</item>
</array>

<array:concat var="names" var_tail="addition"/>
<output>$names[0] and $names[1] are competitors!</output>

<!-- Bill Gates and Steve Jobs are competitors! -->