问题
I am using Symfony 4 on PHP 7.1.14 with Xdebug enabled and html_errors=on
.
When I use {{ dump() }}
function in my twig, data printed on the screen is hard to read because of poor Xdebug formatting (ugly dump). It's also not dumping objects, which is necessary in my case (I see them as an object and can't see their properties).
I remember using this function in Symfony 3 with PHP 7.0.13 and the output was presented as the cool black area with foldable data (cool dump). All PHP options and extensions were the same.
Is there any way to force using Twig dump?
回答1:
In Symfony4, 'dump' appears to be in Flex's 'debug-pack'
composer req debug-pack
回答2:
I think for Symfony4 you have to use the composer require var-dumper
package.
Symfony Docs
来源:https://stackoverflow.com/questions/49511593/how-to-deactivate-xdebug-way-to-dump-data-in-twigs-dump-in-symfony-4