title: I can't use inner functions with Twig_SimpleFilter in Twig_Extension class
body: <p>I have a twig based project with Symfony 2. Due to Symfony 2 nature, Namespaces are used. Because of this i am unable to provide global functions outside of namespace.</p>
  
  <p>This is my Twig Extension <strong>class</strong>:</p>
  
  <pre><code>&lt;?php
  namespace Web\MailBundle\Twig;
  
  use Twig_Extension, Twig_SimpleFilter;
  
  class Twig extends Twig_Extension
  {
      public function getName()
      {
          return 'twig_extension';
      }
  
      public function getFilters() {
          return array(
              'shortKey'  =&gt; new Twig_SimpleFilter('shortKey', 'myCustomFilterFunction')
          );
      }
  
      public function myCustomFilterFunction() {
          //code here...
      }
  </code></pre>
  
  <p><strong>Result</strong>:
  <code>FatalErrorException: Error: Call to undefined function myCustomFilterFunction()</code></p>
  
  <p><strong>Why</strong>:
  Because, Twig is trying to find this function but it is inside of a class. If i move it to outside of class this time i face with namespaces. Because it is namespaced.</p>
  
  <p><strong>Research</strong>:
  I digg the codes. Twig do the same thing. They write the filters and functions outside of class. But due to namespace i canno do that. If possible i wanto to do that by using proper solution. If it fails; I will came with the latest solution which is creating another php file without namespace and include it to the project...</p>
  
  <p>--</p>
  
  <p>How can i get over it? Twig Filter has been deprecated and we have to use SimpleFilter method. But i just couldn't get it done.</p>