Is there a list of Symfony2 default container services?

前端 未结 6 499
小蘑菇
小蘑菇 2020-12-22 21:56

Here is an example, taken from Symfony2 website, about defining a custom service (YAML notation):

services:
    newsletter_manager:
                 


        
6条回答
  •  离开以前
    2020-12-22 22:35

    The command line php app/console container:debug shows the list of services you can inject into another service or get from a Controller with Controller::get($serviceName).

    This list shows only public services. Add the option --show-private into display private services. Private services can only be injected in another service, not accessed from a Controller or any ContainerAware...

    EDIT: From Symfony 2.7, use debug:container instead of container:debug

提交回复
热议问题