Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6984951

Browse files
committed
minor #10554 Minor reword of AbstractController vs Controller (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Minor reword of AbstractController vs Controller This fixes #9926. Commits ------- 5bee7d9 Minor reword of AbstractController vs Controller
2 parents ec537cd + 5bee7d9 commit 6984951

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

controller.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,12 @@ and many others that you'll learn about next.
147147
.. tip::
148148

149149
You can extend either ``Controller`` or ``AbstractController``. The difference
150-
is that when you extend ``AbstractController``, you can't access services directly
151-
via ``$this->get()`` or ``$this->container->get()``. This forces you to write
152-
more robust code to access services. But if you *do* need direct access to the
153-
container, using ``Controller`` is fine.
150+
is that when you extend ``AbstractController``, you can't access to your services
151+
via ``$this->get()`` or ``$this->container->get()``, only to a set of common
152+
Symfony services. This forces you to write more robust code to access services.
153+
154+
Moreover, in Symfony 4.2 ``Controller`` was deprecated in favor of
155+
``AbstractController``, so using the latter will make your apps future-proof.
154156

155157
.. versionadded:: 3.3
156158
The ``AbstractController`` class was added in Symfony 3.3.

0 commit comments

Comments
 (0)