File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ configure the service container to use the
5252 app.newsletter_manager :
5353 class : AppBundle\Email\NewsletterManager
5454 # call a method on the specified service
55- factory : ['@ app.newsletter_manager_factory', createNewsletterManager]
55+ factory : ' app.newsletter_manager_factory: createNewsletterManager'
5656
5757 .. code-block :: xml
5858
@@ -111,6 +111,19 @@ configure the service container to use the
111111 the configured class name may be used by compiler passes and therefore
112112 should be set to a sensible value.
113113
114+ .. note ::
115+
116+ The traditional configuration syntax in YAML files used an array to define
117+ the factory service and the method name:
118+
119+ .. code-block :: yaml
120+
121+ app.newsletter_manager :
122+ # new syntax
123+ factory : ' app.newsletter_manager_factory:createNewsletterManager'
124+ # old syntax
125+ factory : ['@app.newsletter_manager_factory', createNewsletterManager]
126+
114127 Passing Arguments to the Factory Method
115128---------------------------------------
116129
@@ -127,7 +140,7 @@ method in the previous example takes the ``templating`` service as an argument:
127140
128141 app.newsletter_manager :
129142 class : AppBundle\Email\NewsletterManager
130- factory : ['@ newsletter_manager_factory', createNewsletterManager]
143+ factory : ' newsletter_manager_factory: createNewsletterManager'
131144 arguments : ['@templating']
132145
133146 .. code-block :: xml
You can’t perform that action at this time.
0 commit comments