Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ looks up the value of each parameter and uses it in the service definition.

<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>

.. caution::

You may receive a
:class:`Symfony\\Component\\DependencyInjection\\Exception\\ScopeWideningInjectionException`
when passing the ``request`` service as an argument. To understand this
problem better and learn how to solve it, refer to the cookbook article
:doc:`/cookbook/service_container/scopes`.

The purpose of parameters is to feed information into services. Of course
there was nothing wrong with defining the service without using any parameters.
Parameters, however, have several advantages:
Expand Down