Skip to content

Add a note about imported parameters not being immediately available #4207

Closed
@javiereguiluz

Description

@javiereguiluz

This issue was first reported in symfony/symfony#3845 and further discussed in symfony/symfony#9361

The current limitation of the container parameters is as follows. If you have the following parameters.yml file:

# app/config/parameters.yml
parameters:
    my_type: foo

Then the following won't work:

# app/config/config.yml
imports:
    - { resource: parameters.yml }
    - { resource: "%my_type%/security.yml" }

Resolved parameters aren't available immediately, so the my_type parameter imported from parameters.yml cannot be used for example as part of the next file imports.

This doesn't work either for kernel parameters:

imports:
    - { resource: "%kernel.root_dir%/parameters.yml" } # <-- this doesn't work as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions