我正在寻找创建自己的 yml 文件来存储一些可以在我的项目中重复使用的全局设置和变量。我在这里搜索并找到了另一个答案,但它对我不起作用
我正在寻找添加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"
从阅读错误消息看来我错过了什么?我需要添加某种扩展吗?