Oli
Oli

Reputation: 2462

Adding configuration to Symfony Flex project

I'm trying to define some custom config values for my Symfony Flex application (which will be filled with .env values), but all the docs assume I'm using a bundle, like this one: https://symfony.com/doc/current/bundles/extension.html

I have a custom namespace, something like 'Foo\Bar', so I though the Extension class should be called src\DependencyInjection\FooBarExtension.php, but that doesn't work.

Does anyone know how I can load my custom config?

Edit: the following solution worked:

Upvotes: 0

Views: 492

Answers (1)

kix
kix

Reputation: 3319

In Symfony 4.1, you should be able to register a new extension in your AppKernel by overriding the build() method. There, you can register your extensions which in turn enable you to parse your own configuration files.

Upvotes: 2

Related Questions