Skip to content

Add {array} to give the possibility to get an empty array #1166

@garbast

Description

@garbast

In a template I want to start a variable with an empty array to fill it later on with f:merge.

<f:variable name="filteredItems" value="{array}"/>
<f:for each="{allItems}" as="item">
    <f:if condition="{item.uid} > 10">
      <f:variable name="filteredItems" value="{f:merge(a: filteredItems, b: {item.uid: item})"/>
    </f:if>
</f:for>

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingBreaking change, which requires deprecation and major release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions