title: Creating configurations in Symfony
body: <p>For a few hours now I've been struggling to do the most simple thing you can imagine and it just won't work. I've read tons of stackoverflow questions, read the complete Symfony documentation on configuration files and with every article or other piece of information I read, it gets harder and harder to understand.</p>
  
  <h3>Details</h3>
  
  <p>I've created my own Bundle. Lets call it <code>HappyBundle</code>. I've put this Bundle in my company's folder. So naturally I've got <code>CompanyHappyBundle</code>.</p>
  
  <p>I want to make a configuration file specifically for this bundle as I want it to be reusable.</p>
  
  <p>As I test i created the following:</p>
  
  <pre><code># src/Company/HappyBundle/Resources/config/config.yml
  company_happy:
      import:
          path: /tmp
  </code></pre>
  
  <p>Now, what I want is to be able to use this value in my Controller. I just don't know how. It throws me the following error:</p>
  
  <pre><code>[Symfony\Component\Config\Exception\FileLoaderLoadException]
  There is no extension able to load the configuration for "company_happy" (in /home/user/symfony/src/Company/HappyBundle/Resources/config/config.yml).
  
  Looked for namespace "company_happy", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "debug", "web_profiler", "sensio_distribution" in /home/user/symfony/src/Company/HappyBundle/Resources/config/config.yml (which is being imported from "/home/user/symfony/app/config/config.yml").
  </code></pre>
  
  <h3>Update</h3>
  
  <p>In the config.yml I added the following:</p>
  
  <pre><code>#app/config/config.yml
  imports:
      - { resource: "@CompanyHappyBundle/Resources/config/config.yml" }
  </code></pre>
  
  <p>I've also made a Configuration class because I read somewhere this was required. I really do think this is alot of work to make just one config file.</p>
  
  <pre><code>namespace Company\HappyBundle\DependencyInjection;
  
  use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  use Symfony\Component\Config\Definition\ConfigurationInterface;
  
  class Configuration implements ConfigurationInterface
  {
      /**
       * {@inheritDoc}
       */
      public function getConfigTreeBuilder()
      {
          $treeBuilder = new TreeBuilder();
          $rootNode = $treeBuilder-&gt;root('company_happy');
  
          $rootNode
              -&gt;children()
              -&gt;arrayNode('import')
                  -&gt;children()
                      -&gt;scalarNode('attachments_path')-&gt;defaultValue('/tmp')-&gt;end()
                      -&gt;scalarNode('method')-&gt;defaultValue('ALL')-&gt;end()
                      -&gt;booleanNode('move_mail')-&gt;defaultValue(true)-&gt;end()
                      -&gt;booleanNode('mark_read')-&gt;defaultValue(true)-&gt;end()
                  -&gt;end()
              -&gt;end()
          ;
  
          return $treeBuilder;
      }
  }
  </code></pre>
  
  <p>What I am actually looking for are the steps and requirements needed to get this working. The thing with symfony is that it has a million ways to do this. The documentation doesn't just give a workflow.</p>
  
  <p>Can someone please help me out?</p>