G
G
gog692016-07-27 12:32:56
symfony
gog69, 2016-07-27 12:32:56

How to modify third party bundle yaml configuration?

there is a config file in the bundle

system:
    default:
        yui:
            filter: min
            combine: true
            modules:
                capi:
                    path: /vendors/ez-js-rest-client/dist/CAPI.js
                ez-capi:
                    requires: ['capi']
                    path: /js/external/ez-capi.js
                alloyeditor:
                    path: /vendors/alloy-editor/dist/alloy-editor/alloy-editor-all.js
                ez-alloyeditor:

there are 300 of these modules,
I need to add the first three, how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dzubchik, 2016-09-29
@dzubchik

If everything is still relevant, then this is done very simply. A bundle that wants to modify the configuration of another bundle must implement the PrependExtensionInterface interface. And then in the prepend method we simply call

public function prepend(ContainerBuilder $container){
        $name = 'your_bundle_name'; // по конфигу видно что это system
        $config['default']['yui']['modules']['some_module'] = []; // конфигурация вашего модуля
        $container->prependExtensionConfig($name, $config);
}

Documentation: symfony.com/doc/current/bundles/prepend_extension.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question