user1625465
user1625465

Reputation:

how to set my own paramers and config symfony2

i want to use my own parametes.ini file in my symfony project.
does anyone know about that?
I know this file

#app/config/parameters.ini

but I wnat to include my own one.

Upvotes: 1

Views: 542

Answers (2)

Elnur Abdurrakhimov
Elnur Abdurrakhimov

Reputation: 44851

The parameters.ini file should be ignored in a VCS. Instead, copy it to parameters.ini.dist and put it under a VCS control. Then, when developing, each developer copies parameters.ini.dist to parameters.ini and changes parameters to her own needs.

Upvotes: 0

Vitalii Zurian
Vitalii Zurian

Reputation: 17986

In your app/config/config.yml there are lines:

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }

Just add your file there.

imports:
    ...
    - { resource: your_custom_file.yml }

Your custom file should be located in app/config directory. In case if you would like to include file from Bundle - you can import it in next way:

imports:
    ...
    - { resource: "@YourBundle/Resources/config/your_custom_file.yml" }

Upvotes: 1

Related Questions