Fluid icon indicating copy to clipboard operation
Fluid copied to clipboard

Feature request: Allow array merging / replacement in native parser

Open bmack opened this issue 2 years ago • 4 comments

If you work with additionalAttributes in Tag-based ViewHelpers, it would be highly beneficial to have a good "array_replace_recursive" logic.

Example:

<f:media additionalAttributes="{additionalAttributes}" />

But if you want to add more values from another array, a logic such as

<f:media additionalAttributes="{additionalAttributes} + {key: 'my-value'}" />

would be really cool.

bmack avatar Jul 03 '23 14:07 bmack

I think this could be solved by adding the spread operator for arrays (maybe also for ViewHelper tags at a later point):

<my:viewhelper additionalAttributes="{ title: 'my title', ...attrs }" />

s2b avatar Jul 03 '23 15:07 s2b

I made an attempt to implement this in #810

s2b avatar Jul 05 '23 21:07 s2b

related https://github.com/TYPO3/Fluid/issues/336

lolli42 avatar Nov 24 '23 17:11 lolli42

First option with two variables would be made possible by https://github.com/TYPO3/Fluid/pull/396.

NamelessCoder avatar Mar 03 '24 11:03 NamelessCoder

Will be handled in #1123

s2b avatar Jun 26 '25 09:06 s2b