-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
Copy path_imports-parameters-note.rst.inc
36 lines (27 loc) · 1.25 KB
/
_imports-parameters-note.rst.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.. note::
Due to the way in which parameters are resolved, you cannot use them
to build paths in imports dynamically. This means that something like
**the following does not work:**
.. configuration-block::
.. code-block:: yaml
# config/services.yaml
imports:
- { resource: '%kernel.project_dir%/somefile.yaml' }
.. code-block:: xml
<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<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
https://symfony.com/schema/dic/services/services-1.0.xsd"
>
<imports>
<import resource="%kernel.project_dir%/somefile.yaml"/>
</imports>
</container>
.. code-block:: php
// config/services.php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
return static function (ContainerConfigurator $container): void {
$container->import('%kernel.project_dir%/somefile.yaml');
};