我正在尋找創建我自己的yml文件來存儲一些全局設置和變量,我可以在我的項目中重新使用它們。我已經在這裏搜查,發現另一個答案然而symfony2如何創建自己的自定義yml文件以全局共享?
Set own parameters in symfony2
我期待加入report_settings.yml文件,以便它在我的項目中自動加載它並沒有爲我工作。
這是我迄今基於
#app/config/config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: report_settings.yml }
.. rest of config file --
和文件即時試圖包括看起來像這樣
#report_settings.yml
something:
something1: "test"
它返回以下錯誤
FileLoaderLoadException: Cannot import resource "/var/www/pcPortal/app/config/report_settings.yml" from "/var/www/pcPortal/app/config/config.yml".
和
InvalidArgumentException: There is no extension able to load the configuration for "something" (in /var/www/pcPortal/app/config/report_settings.yml). Looked for namespace "something", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "jms_aop", "jms_di_extra", "jms_security_extra", "sj_query", "web_profiler", "sensio_distribution"
從閱讀錯誤信息看起來我錯過了什麼?我是否需要添加某種擴展?
我的問題可能是有用的 - HTTP:// stackoverflow.com/questions/32482622/creating-a-configuration-file-in-symfony2/32502618#32502618 – Peter 2015-09-10 14:26:21