diff --git a/DependencyInjection/ChillCustomFieldsExtension.php b/DependencyInjection/ChillCustomFieldsExtension.php
index 28e35abd8..3f5a1342c 100644
--- a/DependencyInjection/ChillCustomFieldsExtension.php
+++ b/DependencyInjection/ChillCustomFieldsExtension.php
@@ -43,5 +43,14 @@ class ChillCustomFieldsExtension extends Extension implements PrependExtensionIn
// add form layout to twig resources
$twigConfig['form']['resources'][] = 'ChillCustomFieldsBundle:Form:fields.html.twig';
$container->prependExtensionConfig('twig', $twigConfig);
+
+ //add routes for custom bundle
+ $container->prependExtensionConfig('chill_main', array(
+ 'routing' => array(
+ 'resources' => array(
+ '@ChillCustomFieldsBundle/Resources/config/routing.yml'
+ )
+ )
+ ));
}
}
diff --git a/Resources/config/services.yml b/Resources/config/services.yml
index 55fd134c7..c483938fd 100644
--- a/Resources/config/services.yml
+++ b/Resources/config/services.yml
@@ -2,11 +2,6 @@ parameters:
# cl_custom_fields.example.class: Chill\CustomFieldsBundle\Example
services:
- chill.custom_fields.routing_loader:
- class: Chill\CustomFieldsBundle\Routing\RoutesLoader
- tags:
- - { name: routing.loader }
-
chill.custom_field.provider:
class: Chill\CustomFieldsBundle\Service\CustomFieldProvider
call:
diff --git a/Routing/RoutesLoader.php b/Routing/RoutesLoader.php
deleted file mode 100644
index d9a8ab035..000000000
--- a/Routing/RoutesLoader.php
+++ /dev/null
@@ -1,53 +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\CustomFieldsBundle\Routing;
-
-use Symfony\Component\Config\Loader\LoaderInterface;
-use Symfony\Component\Config\Loader\LoaderResolverInterface;
-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 = '@ChillCustomFieldsBundle/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' === $type;
- }
-}