File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,29 @@ Injecting the dependency by the setter method just needs a change of syntax:
456456 and "setter injection". The Symfony service container also supports
457457 "property injection".
458458
459+ .. tip ::
460+
461+ The YAML configuration files support an expanded syntax which may be useful
462+ when the YAML contents are long and complex:
463+
464+ .. code-block :: yaml
465+
466+ # app/config/services.yml
467+ services :
468+ # traditional syntax
469+ app.newsletter_manager :
470+ class : AppBundle\Newsletter\NewsletterManager
471+ calls :
472+ - [setMailer, ['@app.mailer']]
473+
474+ # expanded syntax
475+ app.newsletter_manager :
476+ class : AppBundle\Newsletter\NewsletterManager
477+ calls :
478+ - method : setMailer
479+ arguments :
480+ - ' @app.mailer'
481+
459482 Learn more
460483----------
461484
You can’t perform that action at this time.
0 commit comments