Skip to content

[Twig] allow stringable objects as attribute values #1609

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

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

kbond
Copy link
Member

@kbond kbond commented Mar 11, 2024

Q A
Bug fix? yes
New feature? no
Issues n/a
License MIT

Allows passing a stringable objects as attribute values.

{# currently #}
<twig:Form :action="stringableUriObject"> {# error because stringableUriObject isn't scalar #}

{# with this PR #}
<twig:Form :action="stringableUriObject"> {# auto converts stringableUriObject to string #}

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Mar 11, 2024
@seb-jean
Copy link
Contributor

What will this change? :)

@kbond
Copy link
Member Author

kbond commented Mar 11, 2024

What will this change? :)

I've updated the PR description to show what will change.

@smnandre
Copy link
Member

Great ! Thanks you :)

Minor if you have time:
The description may be a bit missleading, as your PR has no impact on how you pass arguments to components, but how attributes are rendered.
Maybe illustrate with something in the "component view" instead of the "calling template" ?

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Mar 12, 2024
@kbond kbond merged commit 7d735c7 into symfony:2.x Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants