Disable elements in Symfony toolbar

时间:2015-06-30 13:45:58

标签: symfony service toolbar

There are a lot of elements in the Symfony toolbar. I don't need all of them. I already found out that they are called data_collector services. With setting the priority to 0 it's possible to deactivate the time component, but it doesn't seem to work for the translation component.

Is there a single way to disable or remove the services individually?

1 个答案:

答案 0 :(得分:0)

似乎我错过了添加其他data_collector服务所需的其他参数。这就是我当时不需要的其他服务的样子:

services:

    data_collector.translation:
        class: 'Symfony\Component\Translation\DataCollector\TranslationDataCollector'
        tags:
           - {name: 'data_collector', priority: '0'}
        arguments: [@translator.data_collector]

    data_collector.form:
        class: "%data_collector.form.class%"
        tags:
           - {name: 'data_collector', priority: '0'}
        arguments: [@data_collector.form.extractor]

    data_collector.logger:
        class: "%data_collector.logger.class%"
        tags:
           - {name: 'data_collector', priority: '0'}
        arguments: [@logger]

    data_collector.ajax:
        class: 'Symfony\Bundle\FrameworkBundle\DataCollector\AjaxDataCollector'
        tags:
           - {name: 'data_collector', priority: '0'}

    data_collector.twig:
        class: 'Symfony\Bridge\Twig\DataCollector\TwigDataCollector'
        tags:
           - {name: 'data_collector', priority: '0'}
        arguments: [@twig.profile]