how to set my own paramers and config symfony2

浪子不回头ぞ 提交于 2019-12-11 11:04:44

问题


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.


回答1:


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" }



回答2:


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.



来源:https://stackoverflow.com/questions/12127927/how-to-set-my-own-paramers-and-config-symfony2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!