Skip to content

Commit 893c0bd

Browse files
committed
added a note about services locators
1 parent 939b24e commit 893c0bd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

service_container.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,11 @@ But, if you *do* need to make a service public, override the ``public`` setting:
896896
;
897897
};
898898
899+
.. note::
900+
901+
Instead of injecting the container you should consider using a
902+
:ref:`service locator <service-locators>` instead.
903+
899904
.. _service-psr4-loader:
900905

901906
Importing Many Services at once with resource

service_container/service_subscribers_locators.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.. index::
22
single: DependencyInjection; Service Subscribers
33

4+
.. _service-locators:
5+
46
Service Subscribers & Locators
57
==============================
68

0 commit comments

Comments
 (0)