File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed
Bundle/FrameworkBundle/Resources/config
Component/Routing/Loader/DependencyInjection Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 50
50
<argument type =" service" id =" file_locator" />
51
51
</service >
52
52
53
- <service id =" routing.loader.service" class =" Symfony\Component\Routing\Loader\ServiceRouterLoader" public =" false" >
53
+ <service id =" routing.loader.service" class =" Symfony\Component\Routing\Loader\DependencyInjection\ ServiceRouterLoader" public =" false" >
54
54
<tag name =" routing.loader" />
55
55
<argument type =" service" id =" service_container" />
56
56
</service >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Component \Routing \Loader \DependencyInjection ;
13
+
14
+ use Symfony \Component \Config \Loader \Loader ;
15
+ use Symfony \Component \Config \Resource \FileResource ;
16
+ use Symfony \Component \DependencyInjection \ContainerInterface ;
17
+ use Symfony \Component \Routing \Loader \ObjectRouteLoader ;
18
+ use Symfony \Component \Routing \Loader \RouteLoaderInterface ;
19
+ use Symfony \Component \Routing \RouteCollection ;
20
+
21
+ /**
22
+ * A route loader that executes a service to load the routes.
23
+ *
24
+ * This depends on the DependencyInjection component.
25
+ *
26
+ * @author Ryan Weaver <ryan@knpuniversity.com>
27
+ */
28
+ class ServiceRouterLoader extends ObjectRouteLoader
29
+ {
30
+ /**
31
+ * @var ContainerInterface
32
+ */
33
+ private $ container ;
34
+
35
+ public function __construct (ContainerInterface $ container )
36
+ {
37
+ $ this ->container = $ container ;
38
+ }
39
+
40
+ protected function getRouteLoader ($ id )
41
+ {
42
+ return $ this ->container ->get ($ id );
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments