@@ -7,7 +7,7 @@ How to Define Controllers as Services
7
7
In Symfony, a controller does *not * need to be registered as a service. But if you're
8
8
using the :ref: `default services.yml configuration <service-container-services-load-example >`,
9
9
your controllers *are * already registered as services. This means you can use dependency
10
- injection line any other normal service.
10
+ injection like any other normal service.
11
11
12
12
Referencing your Service from Routing
13
13
-------------------------------------
@@ -88,8 +88,8 @@ When using a controller defined as a service, you can still extend any of the
88
88
use their shortcuts. But, you don't need to! You can choose to extend *nothing *,
89
89
and use dependency injection to access difference services.
90
90
91
- The base `Controller class source code `_ is a great way to see how to performance
92
- simple tasks. For example, ``$this->render() `` is usually used to render a Twig
91
+ The base `Controller class source code `_ is a great way to see how to accomplish
92
+ common tasks. For example, ``$this->render() `` is usually used to render a Twig
93
93
template and return a Response. But, you can also do this directly:
94
94
95
95
In a controller that's defined as a service, you can instead inject the ``templating ``
@@ -112,7 +112,7 @@ service and use it directly::
112
112
public function indexAction($name)
113
113
{
114
114
$content = $this->twig->renderResponse(
115
- 'hellp /index.html.twig',
115
+ 'hello /index.html.twig',
116
116
array('name' => $name)
117
117
);
118
118
@@ -130,7 +130,7 @@ The best way to see how to replace base ``Controller`` convenience methods is to
130
130
look at the `ControllerTrait `_ that holds its logic.
131
131
132
132
If you want to know what type-hints to use for each service, see the
133
- ``getSubscribedEvents `` in `AbstractController `_.
133
+ ``getSubscribedEvents() `` method in `AbstractController `_.
134
134
135
135
.. _`Controller class source code` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
136
136
.. _`base Controller class` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
0 commit comments