Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow array merging / replacement in native parser #809

Open
bmack opened this issue Jul 3, 2023 · 4 comments
Open

Feature request: Allow array merging / replacement in native parser #809

bmack opened this issue Jul 3, 2023 · 4 comments

Comments

@bmack
Copy link
Member

bmack commented Jul 3, 2023

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.

@s2b
Copy link
Contributor

s2b commented Jul 3, 2023

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
Copy link
Contributor

s2b commented Jul 5, 2023

I made an attempt to implement this in #810

@lolli42
Copy link
Member

lolli42 commented Nov 24, 2023

related #336

@NamelessCoder
Copy link
Contributor

First option with two variables would be made possible by #396.

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

No branches or pull requests

4 participants