diff --git a/service_container.rst b/service_container.rst index 632da917743..b61c37063e7 100644 --- a/service_container.rst +++ b/service_container.rst @@ -456,6 +456,29 @@ Injecting the dependency by the setter method just needs a change of syntax: and "setter injection". The Symfony service container also supports "property injection". +.. tip:: + + The YAML configuration files support an expanded syntax which may be useful + when the YAML contents are long and complex: + + .. code-block:: yaml + + # app/config/services.yml + services: + # traditional syntax + app.newsletter_manager: + class: AppBundle\Newsletter\NewsletterManager + calls: + - [setMailer, ['@app.mailer']] + + # expanded syntax + app.newsletter_manager: + class: AppBundle\Newsletter\NewsletterManager + calls: + - method: setMailer + arguments: + - '@app.mailer' + Learn more ---------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy