I have an existing project and just would like to know which files and what should I change to make visible the debug toolbar in the prod environment
You should change in the AppKernel.php
file in order to enable the bundle in the prod environment also and change the route moving from the routing_dev.yml
to the routing.yml
the bundle definition route. Then add the configuration in the config.yml
also.
As Example:
AppKernel.php
// Move this outside the if statement
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
routing.yml
#add this
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
config.yml
web_profiler:
toolbar: true
Hope this help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With