Custom configuration file for Symfony project

1k Views Asked by At

My goal is to add to a new Symfony 4.4 project an extra config file to define some behavior of the system. It could be anything, like, pancakes.yaml:

pancakes:
    enablePancakes: false

I wish to know how can I load that config file. find a way to read its parameters and values to change some custom behavior the system might have but honestly I think I'm not smart enough to understand what the documentation says.

For now it could be anything, like printing the configuration file values, for now I only need to know how to load it.

1

There are 1 best solutions below

0
Pierrick Rambaud On

you can update the following file :

# config/service.yaml

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
parameters:
    locale: 'en'
    chat_update_interval: 10000

and use service decoration in your new application to override your parameters.