How do I disable the Symfony 2 profiler bar?

前端 未结 8 1411
清酒与你
清酒与你 2021-01-30 10:29

It\'s not adding anything and it makes the page slower and I want it gone. Don\'t ask. There\'s little about the profiler on the website and nothing in the app config.

8条回答
  •  -上瘾入骨i
    2021-01-30 11:17

    If you set framework.profiler.collect to false in your config.yml, the profiler bar won't be shown (even if web_profiler.toolbar is set to true).

     framework:
        profiler:
            collect: false
    

    This then allows you to selectively activate collectors in your code manually, like this:

    $this->container->get('profiler')->enable();
    

    Documentation here: http://symfony.com/doc/current/reference/configuration/framework.html#collect

提交回复
热议问题