-
-
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
Blank screen when die() in an AbstractExtension #3058
Comments
@fabpot I noticed that too. I did not take time to report this issue. Actually this make developing twig extension much harder (almost impossible). I often do that (I just tested it with a fresh symfony 4.3 install): class FoobarExtension extends AbstractExtension
{
public function getFilters(): array
{
return [
new TwigFilter('foobar', [$this, 'foobar']),
];
}
public function foobar($value)
{
dump($value);die;
}
} Now it display a blank page. Maybe, we can use the |
@lyrixx That is an option indeed. In debug mode, don't flush the output. Would you like to work on a PR? |
Let's go :) |
Thanks for jumping in on this @lyrixx! |
I have a package that wraps larapack/dd in a Twig Extension and I'm having a problem on projects that are using Twig 2.11 (issue on my repo)
Larapack has a 'dump & die' method (
dd
) and using that results in a blank screen, no matter where in the template the extension gets called.Further debugging reveals that it is not related to larapack/dd of my extension specifically, any extension with a
die()
or anexit()
in it results in a blank screen.For reference, this is built as a plugin for craftcms/cms.
This worked on 2.81, but yesterday's Craft update bumped Twig from 2.8.1 to 2.11, which is why the issue shows up now.
Is this an intentional change and if so how can I make this work again? Thanks!
The text was updated successfully, but these errors were encountered: