CFLOOP
Provides a number of mechanisms to loop over data structures.
Usage
<cfloop> ... </cfloop>
Attributes
Attribute | default | required | summary |
---|---|---|---|
[ARRAY] FROM | ![]() |
The start index in the array to start the loop from | |
[ARRAY] TO | ![]() |
The end index in the array to end the loop at | |
[ARRAY] INDEX | ![]() |
The name of the variable that will contain the current position | |
[ARRAY] STEP | 1 | The number to step through | |
[LIST] LIST | ![]() |
Defined if wishing to loop over a list | |
[LIST] DELIMITERS | , | ![]() |
The list of delimiters of this list |
[LIST] INDEX | ![]() |
The name of the variable that will contain the current element in the list | |
[QUERY] QUERY | ![]() |
The name of the Query to loop over | |
[QUERY] STARTROW | , | ![]() |
The starting row of the query |
[QUERY] ENDROW | ![]() |
The end row of the query | |
[CONDITION] CONDITION | ![]() |
The CONDITION that must be evaluated to TRUE to continue the loop | |
[COLLECTION] COLLECTION | ![]() |
The name of the collection/structure that will looped over | |
[COLLECTION] ITEM | ![]() |
The name of the key of the collection on each iteration | |
[ARRAY OBJ] ARRAY | ![]() |
The array object to iterate over | |
[ARRAY OBJ] INDEX | ![]() |
The element (or index) of the array (if INDEX and ITEM are specified then the INDEX is the number of the array, and the ITEM is the element in the array) | |
[ARRAY OBJ] ITEM | ![]() |
The element of the array | |
[FILE] FILE | ![]() |
The path to the file that will iterated over | |
[FILE] INDEX | ![]() |
The name of the variable that will contain the characters from the file | |
[FILE] CHARACTERS | The number of characters that will be read for each iteration. The default is to read the file line-by-line | ||
[FILE] CHARSET | The character set to use for reading the file. Defaults to that of the system |