-
-
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
[v3.9] Unable to use ob_start inside a custom twig method #4034
Comments
Those custom functions were relying on the internal implementation of Twig being based on echoing things in PHP. Thus, using paired functions like that is a weird API: this is not what Twig functions are meant to do and it would be very easy to break things by not pairing them properly (which cannot be properly reported). This is a job for a Twig tag instead (which seems to be exactly what the |
note that if |
Closing for reasons explained by @stof |
Since the new version (I accidentally updated just yesterday), my calls to ob_start returns empty string now.
Before, I have 2 twig functions, which are simplified like this:
My twig may look like this:
It used to work, but now with the new twig it always returns an empty string. Downgrading to 3.8 fixes the issue so I'm pretty sure this has something to do with the new code.
It was suggested that I could use the set block instead, but I want to know if and how I can update my code to work with the new version instead.
The text was updated successfully, but these errors were encountered: