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

Issue when using ternary operator to output content #894

Open
cataem opened this issue Jul 9, 2024 · 0 comments
Open

Issue when using ternary operator to output content #894

cataem opened this issue Jul 9, 2024 · 0 comments

Comments

@cataem
Copy link

cataem commented Jul 9, 2024

Hi. I encountered this weird issue that I don't seem to find anywhere being mentioned.

{% set test2 = 'text 2' %}
{{ dump(test1) }}
{{ test1 ? test1 : test2 }}

This does not render any text. If test1 was set, it would output test1, as expected.

This does output text 2:
{{ test1 ?: test2 }}

Tried this on 1.17.1 as well.
PHP twig renders as expected.

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

1 participant