How to automatically enable routing and config.yml for packages in / vendors

I recently started to separate our custom packages from our Symfony2 application so that they can share several projects. I successfully brought them to my repositories and included them back into the main application through Composer. I know that I need to register them with AppKernal, but I was hoping that I would not have to directly refer to their routing.yml and config.yml files from those in / app / config / * .yml.

Is there a way to automatically include configuration files from packages in the vendors folder?

+4
source share
2 answers

It turns out a colleague did this before when config.yml pointed me to this documentation

http://symfony.com/doc/current/cookbook/bundles/extension.html#using-the-load-method

load() ,

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('config.yml');
$loader->load('services.yml');

routing.yml, , , .

0

All Articles