如何在Symfony 4的Twig的{{dump()}}中停用Xdebug转储数据的方式 [英] How to deactivate Xdebug way to dump data in Twig's {{ dump() }} in Symfony 4

查看:135
本文介绍了如何在Symfony 4的Twig的{{dump()}}中停用Xdebug转储数据的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在启用Xdebug且 html_errors = on 的PHP 7.1.14上使用Symfony 4。



何时我在树枝上使用了 {{dump()}} 函数,由于Xdebug格式不佳(



解决方案

在Symfony4中,转储似乎位于Flex的调试包中

  composer req debug-pack 


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?

解决方案

In Symfony4, 'dump' appears to be in Flex's 'debug-pack'

composer req debug-pack

这篇关于如何在Symfony 4的Twig的{{dump()}}中停用Xdebug转储数据的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆