title: Remove URL parameter using Twig in Symfony2
body: <p>I have a view with a result of a search and some buttons that add filters. The operation is very simple, by clicking on the button called again the current page passing a parameter <code>?foo=foo</code> by URL.</p>
  
  <p>The system works well but I would like to click again on the filter button is active parameter referenced were eliminated.</p>
  
  <p>Is this possible?</p>
  
  <p>Twig code:</p>
  
  <pre><code>&lt;div class="col-lg-12 unfilled" style="float:none; margin-bottom:1.3em"&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'filter': 'pa'})) }}" class="btn btn-default btn-sm {{ app.request.get('filter') == 'pa' ? 'active' : '' }}"&gt;Menor precio&lt;/a&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'filter': 'pd'})) }}" class="btn btn-default btn-sm {{ app.request.get('filter') == 'pd' ? 'active' : '' }}"&gt;Mayor precio&lt;/a&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'stars1': '1'})) }}" class="btn btn-default btn-sm {{ app.request.get('stars1') &gt; 0 ? 'active' : '' }}"&gt;1 &lt;i class="glyphicon glyphicon-star"&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'stars2': '3'})) }}" class="btn btn-default btn-sm {{ app.request.get('stars2') &gt; 0 ? 'active' : '' }}"&gt;2 &lt;i class="glyphicon glyphicon-star"&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'stars3': '5'})) }}" class="btn btn-default btn-sm {{ app.request.get('stars3') &gt; 0 ? 'active' : '' }}"&gt;3 &lt;i class="glyphicon glyphicon-star"&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'stars4': '7'})) }}" class="btn btn-default btn-sm {{ app.request.get('stars4') &gt; 0 ? 'active' : '' }}"&gt;4 &lt;i class="glyphicon glyphicon-star"&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'stars5': '9'})) }}" class="btn btn-default btn-sm {{ app.request.get('stars5') &gt; 0 ? 'active' : '' }}"&gt;5 &lt;i class="glyphicon glyphicon-star"&gt;&lt;/i&gt;&lt;/a&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Thank you very much.</p>