首页 > 其他 > 详细

factory configurator calls in service container

时间:2018-04-30 12:57:16      阅读:218      评论:0      收藏:0      [点我收藏+]

Factory to Create Services
https://symfony.com/doc/current/service_container/factories.html

Service Method Calls and Setter Injection
Usually, you‘ll want to inject your dependencies via the constructor. But sometimes, especially if a dependency is optional, you may want to use "setter injection". For example:
To configure the container to call the setLogger method, use the calls key:https://symfony.com/doc/current/service_container/calls.html

Configure a Service with a Configurator
The service configurator is a feature of the service container that allows you to use a callable to configure a service after its instantiation.

factory configurator calls in service container

原文:https://www.cnblogs.com/qinqiu/p/8973187.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!