diff --git a/DependencyInjection/ChillPersonExtension.php b/DependencyInjection/ChillPersonExtension.php
index 848db5342..1dafadcd0 100644
--- a/DependencyInjection/ChillPersonExtension.php
+++ b/DependencyInjection/ChillPersonExtension.php
@@ -61,5 +61,14 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
array('bundles' => array('ChillPersonBundle')));
$this-> declarePersonAsCustomizable($container);
+
+ //declare routes for person bundle
+ $container->prependExtensionConfig('chill_main', array(
+ 'routing' => array(
+ 'resources' => array(
+ '@ChillPersonBundle/Resources/config/routing.yml'
+ )
+ )
+ ));
}
}
diff --git a/Resources/config/services.yml b/Resources/config/services.yml
index 22e13c32f..9cbcfad18 100644
--- a/Resources/config/services.yml
+++ b/Resources/config/services.yml
@@ -1,12 +1,7 @@
parameters:
# cl_chill_person.example.class: Chill\PersonBundle\Example
-services:
- chill.person.routing_loader:
- class: Chill\PersonBundle\Routing\RoutesLoader
- tags:
- - { name: routing.loader }
-
+services:
chill.person.accompanying_period_closing_motive:
class: Chill\PersonBundle\Form\Type\ClosingMotiveType
scope: request
diff --git a/Routing/RoutesLoader.php b/Routing/RoutesLoader.php
deleted file mode 100644
index 97a285bfe..000000000
--- a/Routing/RoutesLoader.php
+++ /dev/null
@@ -1,52 +0,0 @@
-
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-namespace Chill\PersonBundle\Routing;
-
-use Symfony\Component\Config\Loader\Loader;
-use Symfony\Component\Routing\RouteCollection;
-
-/**
- * Load routes automatically
- *
- * @author Julien Fastré
- */
-class RoutesLoader extends Loader
-{
-
- public function load($resource, $type = null)
- {
- $collection = new RouteCollection();
-
- $resource = '@ChillPersonBundle/Resources/config/routing.yml';
- $type = 'yaml';
-
- $importedRoutes = $this->import($resource, $type);
-
- $collection->addCollection($importedRoutes);
-
- return $collection;
- }
-
- public function supports($resource, $type = null)
- {
- return 'chill_routes_person' === $type;
- }
-}