Symfony2创建服务 [英] Symfony2 create a service
问题描述
symfony2文档中曾经有一个关于如何创建服务的方法(my_mailer),但我似乎在任何地方都找不到。
There used to be a how-to in the symfony2 doc on how to create a service (my_mailer) but I can't seem to find it anywhere.
谁能告诉我在哪里找到它,或者其他一些有关如何在symfony2中创建服务的教程?
Can anyone tell me where to find it, or some other tutorial on how to create a service in symfony2 ?
推荐答案
服务容器- http://symfony.com/doc/current/book/service_container.html
在容器中创建/配置服务- http://symfony.com/doc/current/book/service_container.html#creating-configuring-services-in-the-container
Creating/Configuring Services in the Container - http://symfony.com/doc/current/book/service_container.html#creating-configuring-services-in-the-container
服务的一个很好的例子-Twig扩展- http://symfony.com/doc/current/ cookbook / templating / twig_extension.html
Great example of a service - a Twig Extension - http://symfony.com/doc/current/cookbook/templating/twig_extension.html
这篇关于Symfony2创建服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!