---
title: "Push ViewHelper <f:push>"
manual: "Fluid Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/fluid:typo3fluid-fluid-push"
source: "ViewHelpers/Fluid/Push.rst"
rendered: "2026-10-08T14:12:40+00:00"
---

# Push ViewHelper `<f:push>` {#typo3fluid-fluid-push}

Add a value to a given array variable. If the variable is null or empty,
it will be initialized as an empty array.

> Examples
> ========
>
> Add a value to the end of an array
> ----------------------------------
>
> ```php
> <f:variable name="tags"/>
> <f:for each="{newsItem.tags}" as="tag">
>     <f:push name="tags" value="{tag.title}" />
> </f:for>
>
> ```
>
> Add a value with a key to an array
> ----------------------------------
>
> If the key already exists, the value will be overridden.
>
> ```php
> <f:push name="tags" key="some-key" value="some-value" />
> ```

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

**Arguments**

The following arguments are available for the push ViewHelper:

-   **key**

    -   *Type:* string

    Key that should be used in the array

-   **name**

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

    Name of variable to extend.

-   **value**

    -   *Type:* mixed

    Value to push to specified array variable. If not in arguments then taken from tag content.
