B
B
BonBon Slick2018-01-29 10:27:58
symfony
BonBon Slick, 2018-01-29 10:27:58

Import configuration files that are higher in the folder hierarchy?

https://symfony.com/doc/current/service_container/...
None of this works:

imports:
    - { resource: /config/parameters.yml }
    - { resource: config/parameters.yml }
    - { resource: /parameters.yml }
    - { resource: ./parameters.yml }
    - { resource: ../parameters.yml }

framework:

These are the standard Symfony 4+ settings, they are in the packages folder. I want to import the main parameter file there, which is 1 level higher in the folder /config, and framework.yaml is in the /config/packages
examples on GitHub, everyone throws configs into one folder, and porridge comes out. Since in the 4th version a lot of folders appeared there. test, dev, prod, general folder files, packages....etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2018-01-29
@BonBonSlick

Packages contain settings for third-party libraries, it is somewhat strange to put your configs there. It was thought that their place was in the config/services.yaml file.
However, this option - { resource: ../parameters.yml }works for me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question