Permalink
Browse files

minor #4226 add note about parameters in imports (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

add note about parameters in imports

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | #4207

Commits
-------

a4e36ff add note about parameters in imports
  • Loading branch information...
weaverryan committed Oct 1, 2014
2 parents eac0e51 + a4e36ff commit df167799641899e679a4022dcd260d2f63035276
@@ -418,6 +418,8 @@ configuration.
// app/config/config.php
$loader->import('@AcmeHelloBundle/Resources/config/services.php');
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
The ``imports`` directive allows your application to include service container
configuration resources from any other location (most commonly from bundles).
The ``resource`` location, for files, is the absolute path to the resource
@@ -0,0 +1,31 @@
.. 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 doesn't work:
.. configuration-block::
.. code-block:: yaml
# app/config/config.yml
imports:
- { resource: "%kernel.root_dir%/parameters.yml" }
.. code-block:: xml
<!-- app/config/config.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 http://symfony.com/schema/dic/services/services-1.0.xsd">
<imports>
<import resource="%kernel.root_dir%/parameters.yml" />
</imports>
</container>
.. code-block:: php
// app/config/config.php
$loader->import('%kernel.root_dir%/parameters.yml');
@@ -148,6 +148,8 @@ needed for the ``app/config/dev/config.yml`` file:
// ...
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
Semantic Configuration Files
----------------------------
@@ -262,6 +262,8 @@ The best way to accomplish this is via a new environment called, for example,
'profiler' => array('only-exceptions' => false),
));
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
And with this simple addition, the application now supports a new environment
called ``benchmark``.

0 comments on commit df16779

Please sign in to comment.