Skip to content

Commit fcddead

Browse files
amine-betariOskarStark
authored andcommitted
Update best_practices.rst
1 parent 377d585 commit fcddead

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

best_practices.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ 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 common services (e.g ``twig``, ``router``, ``doctrine``, etc.), directly from the container via ``$this->container->get()`` or ``$this->get()``.
239238
Instead, you must use dependency injection to fetch services by
240239
:ref:`type-hinting action method arguments <controller-accessing-services>` or
241240
constructor arguments.

0 commit comments

Comments
 (0)