Skip to content

Commit 08227be

Browse files
committed
Merge branch '4.4'
* 4.4: fix linelength. refs #12617 Update best_practices.rst
2 parents 02b140a + ad95a07 commit 08227be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

best_practices.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ the fact that a controller should always return a ``Response`` object.
234234
Use Dependency Injection to Get Services
235235
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236236

237-
If you extend the base ``AbstractController``, you can't access services
238-
directly from the container via ``$this->container->get()`` or ``$this->get()``.
237+
If you extend the base ``AbstractController``, you can only access to the most
238+
common services (e.g ``twig``, ``router``, ``doctrine``, etc.), directly from the
239+
container via ``$this->container->get()`` or ``$this->get()``.
239240
Instead, you must use dependency injection to fetch services by
240241
:ref:`type-hinting action method arguments <controller-accessing-services>` or
241242
constructor arguments.

0 commit comments

Comments
 (0)