title: How to use a YAML config file in Silex Framework
body: <p>Is it possible to configure a Silex Application with YAML config files? I bet yes, but how is it done correctly? For instance I want to use different configurations according to the environment, like config.dev.yml and config.prod.yml.</p>
  
  <p>The config file should contain parameters for the app itself and for the registered extensions/services.</p>
  
  <p>Example:</p>
  
  <pre><code>// Debug flag should be set in the config file
  $app['debug'] = true;
  
  // Extension options should also be set in config file
  $app-&gt;register(new Silex\Extension\TwigExtension(), array(
      'twig.path'       =&gt; __DIR__.'/views',
      'twig.class_path' =&gt; __DIR__.'/vendor/Twig/lib',
  ));
  </code></pre>
  
  <p>Do I have to parse the YAML file by myself and set the parameters accordingly or is there a more "magic" way to do this?</p>