Skip to content
Browse files

Used router.resource variable

  • Loading branch information...
1 parent b6e5547 commit d70dfcfc8ac7bd83be8401b1bf371502370502ee @francisbesset francisbesset committed
View
7 DependencyInjection/BeSimpleI18nRoutingExtension.php
@@ -26,7 +26,7 @@ public function load(array $configs, ContainerBuilder $container)
'BeSimple\\I18nRoutingBundle\\Routing\\Generator\\UrlGenerator',
'BeSimple\\I18nRoutingBundle\\Routing\\Router',
));
-
+
foreach ($configs as $config) {
if (isset($config['connection'])) {
if (!isset($config['cache'])) {
@@ -64,10 +64,11 @@ public function load(array $configs, ContainerBuilder $container)
/**
* This is almost copied completly from DoctrineExtension::getEntityManagerCacheDefinition().
- *
+ *
* @param type $cacheDriver
* @param ContainerBuilder $container
- * @return Definition
+ *
+ * @return Definition
*/
protected function getCacheDefinition($cacheDriver, ContainerBuilder $container)
{
View
7 DependencyInjection/Compiler/OverrideRoutingCompilerPass.php
@@ -12,13 +12,6 @@ public function process(ContainerBuilder $container)
$container->setParameter('routing.loader.xml.class', 'BeSimple\\I18nRoutingBundle\\Routing\\Loader\\XmlFileLoader');
$container->setParameter('routing.loader.yml.class', 'BeSimple\\I18nRoutingBundle\\Routing\\Loader\\YamlFileLoader');
- $routerReal = $container->findDefinition('router');
- $arguments = $routerReal->getArguments();
-
$container->setAlias('router', 'i18n_routing.router');
-
-
- $i18nRoutingRouter = $container->findDefinition('i18n_routing.router');
- $i18nRoutingRouter->replaceArgument(3, $arguments[1]);
}
}
View
2 Resources/config/routing.xml
@@ -16,7 +16,7 @@
<service id="i18n_routing.router" class="%i18n_routing.router.class%">
<argument type="service" id="i18n_routing.translator" on-invalid="ignore" />
<argument type="service" id="service_container" />
- <argument /> <!-- routing resource -->
+ <argument>%router.resource%</argument>
<argument type="collection">
<argument key="cache_dir">%kernel.cache_dir%</argument>
<argument key="debug">%kernel.debug%</argument>

0 comments on commit d70dfcf

Please sign in to comment.
Something went wrong with that request. Please try again.