@@ -35,6 +35,19 @@ you'll interact directly with the services that you need. Fortunately, this is
35
35
usually pretty easy and the base ``Controller `` class itself is a great source
36
36
on how to perform many common tasks.
37
37
38
+ .. note ::
39
+
40
+ Specifying a controller as a service takes a little bit more work. The
41
+ primary advantage is that the entire controller or any services passed to
42
+ the controller can be modified via the service container configuration.
43
+ This is especially useful when developing an open-source bundle or any
44
+ bundle that will be used in many different projects. So, even if you don't
45
+ specify your controllers as services, you'll likely see this done in some
46
+ open-source Symfony2 bundles.
47
+
48
+ Using Annotation Routing
49
+ ------------------------
50
+
38
51
When using annotations to setup routing when using a controller defined as a
39
52
service, you need to specify your service as follows::
40
53
@@ -48,17 +61,5 @@ service, you need to specify your service as follows::
48
61
49
62
In this example, ``my_bundle.annot_controller `` should be the id of the
50
63
``AnnotController `` instance defined in the service container. This is
51
- documented in the :doc: `bundles/SensioFrameworkExtraBundle/annotations/routing `
52
- chapter.
53
-
54
- Read more
55
-
56
- .. note ::
57
-
58
- Specifying a controller as a service takes a little bit more work. The
59
- primary advantage is that the entire controller or any services passed to
60
- the controller can be modified via the service container configuration.
61
- This is especially useful when developing an open-source bundle or any
62
- bundle that will be used in many different projects. So, even if you don't
63
- specify your controllers as services, you'll likely see this done in some
64
- open-source Symfony2 bundles.
64
+ documented in the :doc: `/bundles/SensioFrameworkExtraBundle/annotations/routing `
65
+ chapter.
0 commit comments