services6.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?xml version="1.0" ?>
  2. <container xmlns="http://symfony.com/schema/dic/services"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  5. <services>
  6. <service id="foo" class="FooClass" />
  7. <service id="baz" class="BazClass" />
  8. <service id="not_shared" class="FooClass" shared="false" />
  9. <service id="file" class="FooClass">
  10. <file>%path%/foo.php</file>
  11. </service>
  12. <service id="arguments" class="FooClass">
  13. <argument>foo</argument>
  14. <argument type="service" id="foo" />
  15. <argument type="collection">
  16. <argument>true</argument>
  17. <argument>false</argument>
  18. </argument>
  19. </service>
  20. <service id="configurator1" class="FooClass">
  21. <configurator function="sc_configure" />
  22. </service>
  23. <service id="configurator2" class="FooClass">
  24. <configurator service="baz" method="configure" />
  25. </service>
  26. <service id="configurator3" class="FooClass">
  27. <configurator class="BazClass" method="configureStatic" />
  28. </service>
  29. <service id="method_call1" class="FooClass">
  30. <call method="setBar" />
  31. <call method="setBar">
  32. <argument type="expression">service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")</argument>
  33. </call>
  34. </service>
  35. <service id="method_call2" class="FooClass">
  36. <call method="setBar">
  37. <argument>foo</argument>
  38. <argument type="service" id="foo" />
  39. <argument type="collection">
  40. <argument>true</argument>
  41. <argument>false</argument>
  42. </argument>
  43. </call>
  44. </service>
  45. <service id="alias_for_foo" alias="foo" />
  46. <service id="another_alias_for_foo" alias="foo" public="false" />
  47. <service id="decorator_service" decorates="decorated" />
  48. <service id="decorator_service_with_name" decorates="decorated" decoration-inner-name="decorated.pif-pouf"/>
  49. <service id="decorator_service_with_name_and_priority" decorates="decorated" decoration-inner-name="decorated.pif-pouf" decoration-priority="5"/>
  50. <service id="new_factory1" class="FooBarClass">
  51. <factory function="factory" />
  52. </service>
  53. <service id="new_factory2" class="FooBarClass">
  54. <factory service="baz" method="getClass" />
  55. </service>
  56. <service id="new_factory3" class="FooBarClass">
  57. <factory class="BazClass" method="getInstance" />
  58. </service>
  59. </services>
  60. </container>