Symfony 2 Debug Toolbar not showing, breaks HTML in dev environment(Symfony 2 调试工具栏未显示,在开发环境中破坏 HTML)
问题描述
I really need your help with this. I don't know what I've done to break the Symfony 2 toolbar. The debug tool bars stop showing and when I look at the source code of the page, I can see something like this:
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>hello</h1>
<div id="sfwdt
and then the page terminates. This page I set up for debugging use the simplest HTML layout without using any variable and is not behind a firewall. I simply want to get the debugger toolbar showing. It looks like the debugger did try to load but for some reason it teminate at:
<div id="sfwdt
and breaks the entire page. If I turn the debugger off, the ending tag of the body and html come back.
I've searched for the occurrence of 'sfwdt' and it looks like it is from one of the twig templates of the profiler, however, when I modify that template to try things out, nothing change. Any one can point me to the right direction what's going wrong ?
And there's no error message found. I've comment out all services and keep it to the minimum, still no luck.
AppBundle/Resources/views/layout2.html.twig
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>hello</h1>
</body>
</html>
AppBundle/Resources/views/Default/index.html.twig
{% extends "AppBundle::layout2.html.twig" %}
Sorry, I finally found the issue.
One of the custom bundles registers the kernel.response event and try adding a content-length header to the response. The content-length does not take into account the extra code for the debugger bar and it trims out the extra content added for the debugger toolbar !! and it explains why the page always terminates at <div id="sfwdt, because it takes the same number characters as body and html end tags
这篇关于Symfony 2 调试工具栏未显示,在开发环境中破坏 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Symfony 2 调试工具栏未显示,在开发环境中破坏 HTML
基础教程推荐
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01