title: Twig : url_decode
body: <p>I encoded an url parameter with the twig filter url_encode.</p>
  
  <pre><code>// app.request.query.get("date") output 01/04/2016
  
  href="{{ path('page', {date: app.request.query.get("date")|url_encode}) }}"&gt;
  </code></pre>
  
  <p>which output in the url</p>
  
  <pre><code>date=01%252F04%252F2016
  </code></pre>
  
  <p>So in the requested page with url parameters</p>
  
  <pre><code> {{ app.request.query.get("date") }}
  </code></pre>
  
  <p>display 01%2F04%2F2016 but i'd like to have 01/04/2016</p>
  
  <p>I tried using raw filter and also did a twig extension :</p>
  
  <pre><code>&lt;?php
  namespace SE\AppBundle\Twig;
  
  class htmlEntityDecodeExtension extends \Twig_Extension
  {
      public function getFilters()
      {
          return array(
              new \Twig_SimpleFilter('html_entity_decode', array($this, 'htmlEntityDecode'))
          );
      }
  
      public function htmlEntityDecode($html)
      {
          $html = html_entity_decode($html);
          return $html;
      }
  
      public function getName()
      {
          return 'html_entity_decode_extension';
      }
  }
  </code></pre>
  
  <p>But even with this it keeps displaying 01%2F04%2F2016</p>
  
  <p>I get the same result in my controller method with :</p>
  
  <pre><code>echo html_entity_decode($request-&gt;query-&gt;get('date'));
  </code></pre>
  
  <p>What is the proper way to do this?</p>
  
  <p>UPDATE :</p>
  
  <p>the date is from an input of type 'text'. No this is a simple string with numbers and / .</p>