repeat
Summary
Returns a repeated version of the input array.
Usage
input|repeat( times )
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| times | integer | The number of times the array should be repeated. | Yes. |
Returns
An array containing the elements of the input array repeated n times.
Description
This operator returns a repeated version of the input array. The "times" parameter must be used to define the number of times the array should be repeated.
Examples
Example 1
{array( 1, 2, 3, 4 )|repeat( 3 )}The following array will be returned: ( 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 ).
Changed in Exponential 6.0.15
The named parameters of the operator repeat in Exponential 6.0.15 (eZTemplateArrayOperator::namedParameterList(), lib/eztemplate/classes/eztemplatearrayoperator.php), by position:
| Position | 6.0.15 (name in the code) | This page |
|---|---|---|
| 1 | repeat_times, required: No. | times, required: Yes. |
Contributors
- Balazs Halasy
- Graham Brookins Updated
Comments
Add a comment