title: Symfony2, How to register an extension by using the `addExtension()` method on your main `Environment` object
body: <p>I would like to load a new extension in a <code>symfony2</code> project for <code>twig</code> but I don't know where should I put line below to work :</p>
  
  <pre><code>$twig = new Twig_Environment($loader, $config);
  $twig-&gt;addExtension(new Twig_Extension_Debug());
  </code></pre>
  
  <p>Any tutorials for <a href="http://twig.sensiolabs.org/doc/functions/dump.html" rel="noreferrer">http://twig.sensiolabs.org/doc/functions/dump.html</a> ?</p>