在我的包内的Dependency Injection文件夹中
class AcmeDemoExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
public function getAlias()
{
return 'acme_demo';
}
}
我以Yaml格式创建了另一项服务
是否可以在DependencyInjection文件夹中加载多个服务?
类似
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$loader = new YmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('anotherservices.yml');