title: Register Twig Extension in Symfony
body: <p>I want to use <a href="https://github.com/nochso/html-compress-twig#usage" rel="noreferrer">nochso/html-compress-twig extension</a> to compress all html, inline css and js.But it is the first time that I register a new extension on Twig and I am bit confused about where I should add the following lines in my project:</p>
  
  <pre><code>$twig = new Twig_Environment($loader);
  $twig-&gt;addExtension(new \nochso\HtmlCompressTwig\Extension());
  </code></pre>
  
  <p>I was reading the Twig's documentation but it didn't helped me much as they put the same example and just add the following:</p>
  
  <pre><code>Twig does not care where you save your extension on the filesystem, as all extensions must be registered explicitly to be available in your templates.
  
  You can register an extension by using the addExtension() method on your main Environment object:
  </code></pre>
  
  <p>I only want enable the extension globally and be able to use <code>{% htmlcompress %}{% endhtmlcompress %}</code> in any twig template</p>