title: Retrieve data from a form with GET method using symfony2
body: <p>I can't retrieve data from my form, I tried differents ways but no result. My repository : </p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder-&gt;add('min_price', 'text', array('mapped' =&gt; false, 'label' =&gt; 'De la :', 'attr'=&gt;
                                         array(
                                              'placeholder'=&gt;'Pretul minim',
                                              'class'=&gt;'form-control')))
              -&gt;add('max_price', 'text', array('mapped' =&gt; false, 'label' =&gt; 'Pina la :' , 'attr'=&gt;
                                          array(
                                              'placeholder'=&gt;'Pretul maxim',
                                              'class'=&gt;'form-control')))
  
  
              )
      ;
  }
  public function setDefaultOptions(OptionsResolverInterface $resolver)
  {
      parent::setDefaultOptions($resolver);
      $resolver-&gt;setDefaults(array(
          // avoid to pass the csrf token in the url (but it's not protected anymore)
          'csrf_protection' =&gt; false,
      ));
  }
  
  public function getName()
  {
      return '';
  }
  </code></pre>
  
  <p>My controller : </p>
  
  <pre><code>public function showCategoryAction($id, $page, Request $request){
      $em = $this-&gt;getDoctrine()-&gt;getManager();
      $repositoryProduct = $em-&gt;getRepository('ShopDesktopBundle:Product');
  
      $category = $em-&gt;getRepository('ShopDesktopBundle:Category')-&gt;findOneById($id);
      if (!$category) {
          throw $this-&gt;createNotFoundException('Category not found.');
      }
      $aFilter = array();
  
      $entity = new Product();
      $form = $this-&gt;createForm(new ProductType(), $entity,array(
          'action' =&gt; $this-&gt;generateUrl('show_product_category',array("id" =&gt; $id, "name" =&gt; $category-&gt;getCategoryLink(), "page" =&gt; $page )), //Your url to generate
          'method' =&gt; 'GET'
      ));
      $form-&gt;handleRequest($request);
      $aFilter['iMinPrice'] = $form["min_price"]-&gt;getData();
      $aFilter['iMaxPrice'] = $form["max_price"]-&gt;getData();
      print_r($aFilter);
  
      //Searchs products
      $aProducts          = $repositoryProduct-&gt;getProductsOrderByDateDesc($id,null,$aFilter);
      if (!$aProducts) {
          throw $this-&gt;createNotFoundException('Products not found.');
      }
  
      //Create pagination
      $paginator  = $this-&gt;get('knp_paginator');
      $pagination = $paginator-&gt;paginate(
          $aProducts,
          $page,
          3
      );
      //Send data to view
      return $this-&gt;render('ShopDesktopBundle:Category:category.html.twig',array(
          'category'          =&gt; $category,
          'pagination'        =&gt; $pagination,
          'form' =&gt; $form-&gt;createView()
      ));
  }
  </code></pre>
  
  <p>My view : </p>
  
  <pre><code>&lt;form action="{{ path('show_product_category',{ 'id':category.getId(), 'name':category.getCategoryLink() }) }}" method="get" {{ form_enctype(form) }}&gt;
                          &lt;div class="accordion-group"&gt;
                              &lt;div class="accordion-heading"&gt;
                                  &lt;a class="accordion-toggle" data-toggle="collapse" data-parent="" href="#toggleOne"&gt;
                                      &lt;em class="icon-minus icon-fixed-width"&gt;&lt;/em&gt;Pret
                                  &lt;/a&gt;
                              &lt;/div&gt;
                              &lt;div id="toggleOne" class="accordion-body collapse in"&gt;
                                  &lt;div class="accordion-inner"&gt;
                                      {{ form_widget(form) }}
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;input type="submit" class="btn btn-primary marg-left-20" value="Cautare"/&gt;
                      &lt;/form&gt;
  </code></pre>
  
  <p>The view : </p>
  
  <pre><code>show_product_category:
  path:     /{id}/{name}/{page}
  defaults: { _controller: ShopDesktopBundle:Category:showCategory, page: 1}
  requirements:
      id:  \d+
      page: \d+
      _method:  GET|POST
  </code></pre>
  
  <p>So the problem is that I can't retrieve data from thi form. For all situations $aFilter is empty. If for example I put in the view in form POST method the filter is with data from form. My url look like this : 
  ?min_price=10&amp;max_price=50.
  Help me please. Thx in advance.Exist a solution??</p>