symfony2 validation.ymlを分割する その2
ということで、バンドル配下のDependencyInjectionにて同様のことを記述してみた。
public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); //以下追加 $validators = $container->getParameter('validator.mapping.loader.yaml_files_loader.mapping_files'); $add_files = glob( dirname(__DIR__).'/Resources/config/*validation.yml' ); foreach( $add_files as $file ){ $validators[] = $file; } $container->setParameter('validator.mapping.loader.yaml_files_loader.mapping_files', $validators); }