title: Extending Twig with new function. Can I access exisiting functions?
body: <p>I'm extending Twig using this:</p>
  
  <pre><code>namespace Acme\Bundle\MyBundle\Twig;
  
  use Twig_SimpleFunction;
  
  class LinkGenerator extends \Twig_Extension
  {
  
      public function getFunctions() {
  
          return array(
              new Twig_SimpleFunction('link', function($param) {
                  return "TEST " . $param;
              })
          );
  
      }
  
      public function getName() {
  
          return "link";
  
      }
  
  }
  </code></pre>
  
  <p>It works fine. Using {{ link(2) }} returns 'TEST 2'.</p>
  
  <p>For demo purposes, I want to simply append the query sting ?link=1 to what this would render if using the 'url' Twig function.</p>
  
  <p>So code might look like this:</p>
  
  <pre><code>new Twig_SimpleFunction('link', function($param) {
  
      //render exactly how this would look if using the Twig 'url' function
      $url = $this-&gt;runFunction('url', $params);
  
      //append the query string
      $url .= "?link=1";
  
      return $url;
  
  })
  </code></pre>