services9.xml 2.3 KB

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