1
votes

I'm playing with Symfony reusable bundles and I want to make some bundle with default configuration for all my other projects like common entities, controllers etc. But the problem is taht I want to keep some default configuration for 3rd party bundles in that bundle too (easy admin, fos user bundle,...).

I would like to set some default configuration in my bundle and in case of need override it in app/config... Is this possible and if yes, how can I achieve that.

Thanks in advance

2

2 Answers

1
votes

You need use prepend extension config for keep other extension configurations.

Follow the documantation

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

0
votes

You can maybe write a compiler pass that will set parameters in your 3rd party bundle.

Here is an example of compiler pass I did here.

so in your compiler pass you would have something like:

$fosParameters = ['db_driver' => 'orm', 'firewall_name' => 'main'];

$container->setParameter(
    'fos_user',
    $fosParameters
);

also, do not forget to add your compiler pass to your bundle file like I did here.

I am not 100% sure this will work but I do not see why it would not work.