Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function load(array $configs, ContainerBuilder $container)
 {
     $configuration = new Configuration();
     $config = $this->processConfiguration($configuration, $configs);
     $container->setParameter('om_cms_i18n.locale.filename', $container->getParameterBag()->resolveValue($config['db_locales_filename']));
     $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services.yml');
     $locales = Locales::getDbLocalesFromFile($container->getParameter('om_cms_i18n.locale.filename'));
     if (!empty($locales)) {
         $container->setParameter('sonata_translation.locales', $locales);
     }
 }
Beispiel #2
0
 public function process(ContainerBuilder $container)
 {
     $locales = Locales::getDbLocalesFromFile($container->getParameter('om_cms_i18n.locale.filename'));
     if (!empty($locales)) {
         $container->setParameter('jms_i18n_routing.locales', $locales);
     }
     $definition = $container->getDefinition('jms_i18n_routing.loader');
     $definition->setClass('TheRat\\OmCms\\I18nBundle\\Routing\\Loader');
     $definition = $container->getDefinition('jms_i18n_routing.router');
     $definition->setClass('TheRat\\OmCms\\I18nBundle\\Routing\\Router');
     $definition->addMethodCall('setLocales', ['%jms_i18n_routing.locales%']);
     $definition = $container->getDefinition('jms_i18n_routing.pattern_generation_strategy.default');
     $definition->setClass('TheRat\\OmCms\\I18nBundle\\Routing\\PatternGenerationStrategy');
     $definition->addMethodCall('setContainer', [new Reference('service_container')]);
 }