File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,12 @@ You can configure the service configurator using the ``configurator`` option:
127
127
app.newsletter_manager :
128
128
class : AppBundle\Mail\NewsletterManager
129
129
arguments : ['@mailer']
130
- configurator : ['@ app.email_configurator', configure]
130
+ configurator : ' app.email_configurator: configure'
131
131
132
132
app.greeting_card_manager :
133
133
class : AppBundle\Mail\GreetingCardManager
134
134
arguments : ['@mailer']
135
- configurator : ['@ app.email_configurator', configure]
135
+ configurator : ' app.email_configurator: configure'
136
136
137
137
.. code-block :: xml
138
138
@@ -186,6 +186,23 @@ You can configure the service configurator using the ``configurator`` option:
186
186
->setConfigurator(array(new Reference('app.email_configurator'), 'configure'))
187
187
;
188
188
189
+ .. note ::
190
+
191
+ The traditional configurator syntax in YAML files used an array to define
192
+ the service id and the method name:
193
+
194
+ .. code-block :: yaml
195
+
196
+ app.newsletter_manager :
197
+ # new syntax
198
+ configurator : ' app.email_configurator:configure'
199
+ # old syntax
200
+ configurator : ['@app.email_configurator', configure]
201
+
202
+ .. versionadded :: 3.2
203
+ The ``service_id:method_name `` syntax for the YAML configuration format
204
+ was introduced in Symfony 3.2.
205
+
189
206
That's it! When requesting the ``app.newsletter_manager `` or
190
207
``app.greeting_card_manager `` service, the created instance will first be
191
208
passed to the ``EmailConfigurator::configure() `` method.
You can’t perform that action at this time.
0 commit comments