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
16 changes: 8 additions & 8 deletions service_container/configurators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,16 @@ all the classes are already loaded as services. All you need to do is specify th
$container->getDefinition(GreetingCardManager::class)
->setConfigurator(array(new Reference(EmailConfigurator::class), 'configure'));
The traditional configurator syntax in YAML files used an array to define
the service id and the method name:
The traditional configurator syntax in YAML files used an array to define
the service id and the method name:

.. code-block:: yaml
.. code-block:: yaml
app.newsletter_manager:
# new syntax
configurator: 'App\Mail\EmailConfigurator:configure'
# old syntax
configurator: ['@App\Mail\EmailConfigurator', configure]
app.newsletter_manager:
# new syntax
configurator: 'App\Mail\EmailConfigurator:configure'
# old syntax
configurator: ['@App\Mail\EmailConfigurator', configure]
That's it! When requesting the ``App\Mail\NewsletterManager`` or
``App\Mail\GreetingCardManager`` service, the created instance will first be
Expand Down