Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteff9733

Browse files
committed
removing more scope stuff
1 parent81c7572 commiteff9733

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

‎book/service_container.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -884,20 +884,6 @@ Now, just inject the ``request_stack``, which behaves like any normal service:
884884
array(new Reference('request_stack'))
885885
));
886886
887-
..sidebar::Why not Inject the ``request`` Service?
888-
889-
Almost all Symfony2 built-in services behave in the same way: a single
890-
instance is created by the container which it returns whenever you get it or
891-
when it is injected into another service. There is one exception in a standard
892-
Symfony2 application: the ``request`` service.
893-
894-
If you try to inject the ``request`` into a service, you will probably receive
895-
a
896-
:class:`Symfony\\Component\\DependencyInjection\\Exception\\ScopeWideningInjectionException`
897-
exception. That's because the ``request`` can **change** during the life-time
898-
of a container (when a sub-request is created for instance).
899-
900-
901887
..tip::
902888

903889
If you define a controller as a service then you can get the ``Request``

‎components/dependency_injection/parentservices.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ called when the child services are instantiated.
277277

278278
..caution::
279279

280-
The ``scope``, ``abstract`` and ``tags`` attributes are always taken
281-
from the child service.
280+
The ``abstract`` and ``tags`` attributes are always taken from the child service.
282281

283282
The parent service is abstract as it should not be directly retrieved from
284283
the container or passed into another service. It exists merely as a "template"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp