H
H
hitchen2015-02-14 20:21:41
symfony
hitchen, 2015-02-14 20:21:41

How to override configs connected via DI in symfony2?

Hello. There are installed vendors, and override folders in src/Application/bundle name. Controllers, etc. are redefined as needed, however, vendor bundle configs are connected via DI in this way:

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('page.xml');
        $loader->load('serializer.xml');

When creating in src/Application/, the name of a bundle of config files with similar paths is not redefined. When you create a DependencyInjection folder, DI is also not overridden. I know that you can create new configs, add the necessary services there, and connect them via config.yml, but I don’t want to create confusion, besides, this only makes it possible to create new services, and not edit existing ones.
Is it possible to somehow override or extend existing configs without getting into the vendor's code?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-02-14
Protko @Fesor

Yes, symfony.com/doc/current/cookbook/bundles/inheritan...
ps something tells me you're doing something bad...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question