I am looking to create my own yml file to store some global settings and vars that I can re-use across my project. I have searched on here and found another answer however it does not work for me
Set own parameters in symfony2
I'm looking to add the report_settings.yml file so that its automatically loaded across my project.
this is what I have so far based
#app/config/config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: report_settings.yml }
.. rest of config file --
and the file im trying to include looks like this
#report_settings.yml
something:
something1: "test"
It returns the following error
FileLoaderLoadException: Cannot import resource "/var/www/pcPortal/app/config/report_settings.yml" from "/var/www/pcPortal/app/config/config.yml".
and
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"
From reading the error messages it looks like I have missed something out? Do I need to add some kind of extension?
The simplest would be to put your config into the parameters section like:
#report_settings.yml
parameters:
something.something1: "test"
You could also process the config with your own extension see http://symfony.com/doc/master/book/service_container.html#importing-configuration-via-container-extensions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With