---
title: "For ViewHelper <f:for>"
manual: "Fluid ViewHelper Reference"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-for@13.4"
source: "Global/For.rst"
modified: "2026-09-17T09:07:45+00:00"
---

# For ViewHelper `<f:for>`

Loop ViewHelper which can be used to iterate over arrays.
Implements what a basic PHP `foreach()` does.

Go to the source code of this ViewHelper: [ForViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/ForViewHelper.php).

## Arguments of the `<f:for>` ViewHelper

-   **as**

    -   *Type:* string
    -   *Required:* true

    The name of the iteration variable

-   **each**

    -   *Type:* array
    -   *Required:* true

    The array or \\SplObjectStorage to iterated over

-   **iteration**

    -   *Type:* string

    The name of the variable to store iteration information (index, cycle, total, isFirst, isLast, isEven, isOdd)

-   **key**

    -   *Type:* string

    Variable to assign array key to

-   **reverse**

    -   *Type:* boolean
    -   *Default:* false

    If true, iterates in reverse
