1

When we install symfony 2, installer will ask for values of variables from parameter.yml.dist that are not present in parameter.yml.

Is there a way to create your custom yml and yml.dist file in App/config?

e.g. my.yml will be created while installing and parameters defined in my.yml.dist will be prompted for values at the time of installation.

1
  • ask question proper way Commented Apr 27, 2016 at 7:54

1 Answer 1

3

Yes, you can create a bunch of custom configuration files. However this is not strictly related to Symfony itself - it's Composer with Incenteev/ParameterHandler "extension".

In your composer.json file you'll find following fragment:

"extra": {
    "incenteev-parameters": {
        "file": "app/config/parameters.yml",
        "env-map": {
            ...
        }
    }
}

Change it to an array of incenteev-parameters:

"extra": {
    "incenteev-parameters": [
        {
            "file": "app/config/parameters.yml",
            "env-map": {
                ...
            }
        },
        {
            "file": "app/config/my-custom-config.yml",
            "env-map": {
                ...
            }
        }
    ]
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.