Import yml config in symfony2 config.yml file

symfony, yaml

Solution

Configuration from config.yml is loaded by extensions. Do you have one for your sso_accounts? It seems that you haven't.

You can read how it works here: http://symfony.com/doc/current/cookbook/bundles/extension.html

Problem

In my Symfony2 config.yml file, I'd like to import some configs that I'd prefer gather in a separate yml file. I used: ``` imports: - { resource: parameters.yml } - { resource: sso_accounts.yml } ``` And in my sso_accounts.yml file I basically have: ``` sso_accounts: company: publickey: publickey secret: privatekey users: [ user1@email.com, user2@email.com ] ``` But (there's always a but...) I got this error: ``` Whoops, looks like something went wrong. 2/2 FileLoaderLoadException: Cannot import resource "/Users/mycomp/Sites/myapp/app/config/sso_accounts.yml" from "/Users/mycomp/Sites/myapp/app/config/config.yml". 1/2 InvalidArgumentException: There is no extension able to load the configuration for "sso_accounts" (in /Users/mycomp/Sites/myapp/app/config/sso_accounts.yml). Looked for namespace "sso_accounts", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "assetic", "sensio_framework_extra", "jms_security_extra", "problematic_acl_manager", "twig_js", "fos_js_routing" ``` What's wrong with my import?

Original source