From d0e0e8ff5069b2420559d633c6979e5d81a8cdf5 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 01:46:03 +0000 Subject: [PATCH 1/7] Document the yaml_file usage --- service_container.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/service_container.rst b/service_container.rst index 6983ea058f6..bf1b80b7c81 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1072,6 +1072,44 @@ If you want to pass the second, you'll need to :ref:`manually wire the service < and the automatically loaded service will be passed - by default - when you type-hint ``SiteUpdateManager``. That's why creating the alias is a good idea. +Injecting the content of YAML file as argument +---------------------------------------------- + +You can automatically parse a YAML file and injecting it as an argument be referencing the **absolute path** to the file, +or the relative path from **your configuration file**: + +.. configuration-block:: + + .. code-block:: yaml + + # config/services.yaml + services: + # ... + + App\ServiceWithYamlInside: + arguments: + - !yaml_file '%kernel.root_dir%/some/file.yaml' + + .. code-block:: xml + + + + + + + + + + %kernel.root_dir%/some/file.yaml + + + + +You need the :doc:`YAML component ` to use this feature. + Learn more ---------- From 235372c6bbd31f8688667ec75f521a19628b458f Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 01:54:51 +0000 Subject: [PATCH 2/7] Typo fix --- service_container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container.rst b/service_container.rst index bf1b80b7c81..e00783fbf4c 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1075,7 +1075,7 @@ If you want to pass the second, you'll need to :ref:`manually wire the service < Injecting the content of YAML file as argument ---------------------------------------------- -You can automatically parse a YAML file and injecting it as an argument be referencing the **absolute path** to the file, +You can automatically parse a YAML file and injecting it as an argument by referencing the **absolute path** to the file, or the relative path from **your configuration file**: .. configuration-block:: From a3914cf14d39b14e92fe1f1ca2be889006402e98 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 02:08:34 +0000 Subject: [PATCH 3/7] Rename XML type --- service_container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container.rst b/service_container.rst index e00783fbf4c..064691b2b85 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1103,7 +1103,7 @@ or the relative path from **your configuration file**: - %kernel.root_dir%/some/file.yaml + %kernel.root_dir%/some/file.yaml From 8c4ed4e86c7aa8824903f6da2ab66ec3e684ab98 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 02:10:30 +0000 Subject: [PATCH 4/7] Rename service --- service_container.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service_container.rst b/service_container.rst index 064691b2b85..fa333bffbdb 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1086,7 +1086,7 @@ or the relative path from **your configuration file**: services: # ... - App\ServiceWithYamlInside: + App\ServiceWithArrayConfigFromYamlFile: arguments: - !yaml_file '%kernel.root_dir%/some/file.yaml' @@ -1102,7 +1102,7 @@ or the relative path from **your configuration file**: - + %kernel.root_dir%/some/file.yaml From 31375d7142a1064fa81b8c89917b923c18d73059 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 12:58:52 +0000 Subject: [PATCH 5/7] Add version added --- service_container.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service_container.rst b/service_container.rst index fa333bffbdb..1ca5584a66d 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1075,6 +1075,10 @@ If you want to pass the second, you'll need to :ref:`manually wire the service < Injecting the content of YAML file as argument ---------------------------------------------- +.. versionadded:: 4.3 + Support for the YAML file notation in YAML and XML was introduced + in Symfony 4.3. + You can automatically parse a YAML file and injecting it as an argument by referencing the **absolute path** to the file, or the relative path from **your configuration file**: From 4fca3ae83ac6eac47475d3acf6ee823d7f0c4e1f Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 19:52:35 +0000 Subject: [PATCH 6/7] Add blank line --- service_container.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/service_container.rst b/service_container.rst index 1ca5584a66d..9406d57e6d7 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1076,6 +1076,7 @@ Injecting the content of YAML file as argument ---------------------------------------------- .. versionadded:: 4.3 + Support for the YAML file notation in YAML and XML was introduced in Symfony 4.3. From 9e30f6138c470fc594dd4779b8090d7d35f38278 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Sun, 10 Mar 2019 22:10:38 +0000 Subject: [PATCH 7/7] Use https --- service_container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container.rst b/service_container.rst index 9406d57e6d7..c55d135702e 100644 --- a/service_container.rst +++ b/service_container.rst @@ -1102,7 +1102,7 @@ or the relative path from **your configuration file**: + https://symfony.com/schema/dic/services/services-1.0.xsd">