8000 Remove block which doesn't make sense after best practices by ifdattic · Pull Request #4929 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Remove block which doesn't make sense after best practices #4929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2015
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
43 changes: 0 additions & 43 deletions components/dependency_injection/parameters.rst
8000
Original file line number Diff line number Diff line change
Expand Up @@ -140,49 +140,6 @@ rather than being tied up and hidden with the service definition:
If you were using this elsewhere as well, then you would only need to change
the parameter value in one place if needed.

You can also use the parameters in the service definition, for example,
making the class of a service a parameter:

.. configuration-block::

.. code-block:: yaml

parameters:
mailer.transport: sendmail

services:
mailer:
class: Mailer
arguments: ["%mailer.transport%"]

.. code-block:: xml

<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="mailer.transport">sendmail</parameter>
</parameters>

<services>
<service id="mailer" class="Mailer">
<argument>%mailer.transport%</argument>
</service>
</services>
</container>

.. code-block:: php

use Symfony\Component\DependencyInjection\Reference;

$container->setParameter('mailer.transport', 'sendmail');

$container
->register('mailer', 'Mailer')
->addArgument('%mailer.transport%');

.. note::

The percent sign inside a parameter or argument, as part of the string, must
Expand Down
0