Skip to content

Conversation

@staatzstreich
Copy link
Contributor

A new <f:merge> ViewHelper should be added to Fluid, which merges two arrays, optionally recursively.

Arguments:

array $array
array $with
bool $recursive
See also the php array_merge() and the php array_merge_recursive() functions.

Examples:

<f:variable name="merged" value="{f:merge(array: input, with: toMerge)}" />
<f:variable name="merged" value="{input -> f:merge(with: toMerge)}" />

@staatzstreich
Copy link
Contributor Author

I decided to came up with other parameter names: "array" and "with"... I think it is more readable.

@s2b s2b merged commit c90fffb into TYPO3:main Aug 17, 2025
5 checks passed
s2b pushed a commit that referenced this pull request Aug 17, 2025
A new <f:merge> ViewHelper is introduced to Fluid, which merges two arrays, optionally recursively.

Arguments:

array $array
array $with
bool $recursive
See also [the php array_merge()](https://www.php.net/manual/en/function.array-merge.php) and [the php array_merge_recursive()](https://www.php.net/manual/en/function.array-merge-recursive.php) functions.

Examples:

```
<f:variable name="merged" value="{f:merge(array: input, with: toMerge)}" />
<f:variable name="merged" value="{input -> f:merge(with: toMerge)}" />
```

Resolves: #1123
@s2b
Copy link
Contributor

s2b commented Aug 17, 2025

Thank you for your contribution!

s2b added a commit that referenced this pull request Aug 17, 2025
A new <f:merge> ViewHelper is introduced to Fluid, which merges two arrays, optionally recursively.

Arguments:

array $array
array $with
bool $recursive
See also [the php array_merge()](https://www.php.net/manual/en/function.array-merge.php) and [the php array_merge_recursive()](https://www.php.net/manual/en/function.array-merge-recursive.php) functions.

Examples:

```
<f:variable name="merged" value="{f:merge(array: input, with: toMerge)}" />
<f:variable name="merged" value="{input -> f:merge(with: toMerge)}" />
```

Resolves: #1123

Co-authored-by: Michael Staatz <michael@staatzstreich.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants