Symfony 2 debug toolbar not showing
Double-check that your <body>
tag has a closing </body>
tag. In my experience, when the toolbar suddenly disappears it's because the closing body tag is missing due to malformed HTML, or because a controller is returning a Response
object with just plain text content.
Make sure you can tick all bullets in this checklist:
- You are using the dev mode by accessing the page via app_dev.php (True for you)
The toolbar inserts itself in pages by looking for a terminating
</body>
tag on your generated page. If you don't have a</body>
tag in your page the toolbar will not appear(as in the above answer). Example twig file as a reference:The line
{% extends '::base.html.twig' %}
will extendapp/Resources/views/base.html.twig
which injects default<body>...</body>
into your custom twig files.{% extends '::base.html.twig' %} {% block body %} Hello! {% endblock %}
You have enabled the profiler in
AppKernel.php
public function registerBundles(){ $bundles = ... if (in_array($this->getEnvironment(), array('dev', 'test'))) { $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); ... } return $bundles; }
You have javascript enabled.
Thoroughly Check recently added bundles(specially custom ones). Because Cases like this can cause the problem.