title: Symfony, How to generate Asset URL in a Twig Extension class?
body: <p>I have one class which extends <code>\Twig_Extension</code> like below :</p>
  
  <pre><code>class MYTwigExtension extends \Twig_Extension
  {
  
      protected $doctrine;
  
      protected $router;
  
  
      public function __construct(RegistryInterface $doctrine , $router)
      {
          $this-&gt;doctrine = $doctrine;
          $this-&gt;router = $router;
  
      }
  
      public function auth_links($user , $request)
      {
         // Some other codes here ...
  
         // HOW TO GENERATE $iconlink which is like '/path/to/an/image'
  
         $html .= "&lt;img src=\"$iconlink\" alt=\"\" /&gt;  ";  
  
         echo $html;
      }
  
  }
  </code></pre>
  
  <p>My question is How to generate Asset links in a Twig Extension ? I would like a replacement for ASSET helper in my class. Bassically I have no idea what I have to inject or use here ! Thanks in advance.   </p>
  
  <pre><code> &lt;img src="{{ asset('img/icons/modules/timesheet.png') }}" alt="" /&gt; 
  </code></pre>