-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for Twig\Markup
#4467
Conversation
I think this should be a generic solution, not just for this specific extension. It also feels similar to this problem I tried to solve: #4124 |
In the meantime, that seems legit to me. @fabpot? |
It already works for core extension, {{ obj }} is casted into string |
For reminder, this PR is about
{{ html_classes(class_a, {
(stringableObjectThatMightBeConvertedToAClass): true
}) }} Which currently throws exception. Can you please take a closer look at it? 🙏 |
I must be missing something here, but even without your patch, the new test passes. See #4506 where I've added your test without changing the code. |
Sorry, the test case was the wrong one. You should get an error in the current code with: {{ html_classes(stringableObjectThatMightBeConvertedToAClass) }} The test fixtures have been updated accordingly. |
Co-authored-by: Fabien Potencier <fabien@potencier.org>
Thank you @nlemoine. |
No description provided.