services9.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" ?>
  2. <container xmlns="http://www.symfony-project.org/schema/dic/services"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">
  5. <parameters>
  6. <parameter key="baz_class">BazClass</parameter>
  7. <parameter key="foo_class">FooClass</parameter>
  8. <parameter key="foo">bar</parameter>
  9. </parameters>
  10. <services>
  11. <service id="foo" class="FooClass" factory-method="getInstance" shared="false">
  12. <tag name="foo" foo="foo" />
  13. <tag name="foo" bar="bar" />
  14. <file>%path%foo.php</file>
  15. <argument>foo</argument>
  16. <argument type="service" id="foo.baz" />
  17. <argument type="collection">
  18. <argument key="%foo%">foo is %foo%</argument>
  19. <argument key="bar">%foo%</argument>
  20. </argument>
  21. <argument>true</argument>
  22. <argument type="service" id="service_container" />
  23. <call method="setBar">
  24. <argument>bar</argument>
  25. </call>
  26. <call method="initialize" />
  27. <configurator function="sc_configure" />
  28. </service>
  29. <service id="bar" class="FooClass">
  30. <argument>foo</argument>
  31. <argument type="service" id="foo.baz" />
  32. <argument>%foo_bar%</argument>
  33. <configurator service="foo.baz" method="configure" />
  34. </service>
  35. <service id="foo.baz" class="%baz_class%" factory-method="getInstance">
  36. <configurator class="%baz_class%" method="configureStatic1" />
  37. </service>
  38. <service id="foo_bar" class="%foo_class%">
  39. </service>
  40. <service id="method_call1" class="FooClass">
  41. <call method="setBar">
  42. <argument type="service" id="foo" />
  43. </call>
  44. <call method="setBar">
  45. <argument type="service" id="foo" on-invalid="null" />
  46. </call>
  47. <call method="setBar">
  48. <argument type="service" id="foo" on-invalid="ignore" />
  49. </call>
  50. <call method="setBar">
  51. <argument type="service" id="foobaz" on-invalid="ignore" />
  52. </call>
  53. </service>
  54. <service id="factory_service" factory-method="getInstance" factory-service="foo.baz">
  55. </service>
  56. <service id="alias_for_foo" alias="foo" />
  57. </services>
  58. </container>