@@ -7,7 +7,7 @@ How to Define Controllers as Services
77In Symfony, a controller does *not * need to be registered as a service. But if you're
88using the :ref: `default services.yml configuration <service-container-services-load-example >`,
99your 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.
1111
1212Referencing your Service from Routing
1313-------------------------------------
@@ -88,8 +88,8 @@ When using a controller defined as a service, you can still extend any of the
8888use their shortcuts. But, you don't need to! You can choose to extend *nothing *,
8989and use dependency injection to access difference services.
9090
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
9393template and return a Response. But, you can also do this directly:
9494
9595In a controller that's defined as a service, you can instead inject the ``templating ``
@@ -112,7 +112,7 @@ service and use it directly::
112112 public function indexAction($name)
113113 {
114114 $content = $this->twig->renderResponse(
115- 'hellp /index.html.twig',
115+ 'hello /index.html.twig',
116116 array('name' => $name)
117117 );
118118
@@ -130,7 +130,7 @@ The best way to see how to replace base ``Controller`` convenience methods is to
130130look at the `ControllerTrait `_ that holds its logic.
131131
132132If you want to know what type-hints to use for each service, see the
133- ``getSubscribedEvents `` in `AbstractController `_.
133+ ``getSubscribedEvents() `` method in `AbstractController `_.
134134
135135.. _`Controller class source code` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
136136.. _`base Controller class` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
0 commit comments