title: Knp Paginator with search form
body: <p>I'm trying to use KNP paginator with a form-search.</p>
  
  <p>Everything works fine, but when I go to page 2 they send me back to page 2 without the result of the search.</p>
  
  <p>I used POST methods on my twig because if I use GET methods, nothing happening.</p>
  
  <p>I found many post on my issue but I don't know how can I resolve it. If someone has some advices for me, please can you help me please.</p>
  
  <p>This is my code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function rechercheAction() {
          $form = $this-&gt;createForm(RechercheClientType::class);
          return $this-&gt;render('admin/client/recherche.html.twig',[
                  'form' =&gt; $form-&gt;createView()
              ]
          );
      }
  
  
      /**
       * @Route("/admin/client/recherche", name="recherche_client")
       */
      public function rechercheTraitementAction(PaginatorInterface $paginator,Request $request) {
  
  
          $session = $request-&gt;getSession();
  
  
          $form = $this-&gt;createForm(RechercheClientType::class);
          $form-&gt;handleRequest($request);
  
          $query = $this-&gt;repository-&gt;recherche($form['rechercheClient']-&gt;getData());
  
          $users = $paginator-&gt;paginate(
              $query,
              $request-&gt;query-&gt;getInt('page',1), 10
          );
  
          //Compte le nombre d'éléments recherchés
          $count = count($query);
  
  
  
  
          return $this-&gt;render('admin/client/data-tables.html.twig',[
                  'users' =&gt; $users,
                  'count' =&gt;$count,
              ]
          );
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- recherche.html.twig --&gt;
  &lt;form action="{{ path('recherche_client') }}" method="post"&gt;
  {{ form_widget(form.rechercheClient, { 'attr': { 'class' : "form-control",'placeholder': "Rechercher par ID, nom , prénom, mail ou société"} }) }}
  {{ form_widget(form) }}
  &lt;/form&gt;
  
  &lt;!-- data-table.html.twig --&gt;
    &lt;div class="" style="float:right"&gt;
  
     {{ knp_pagination_render(users) }}
  
  
     &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function recherche($chaine) {
      return $this-&gt;createQueryBuilder('u')
          -&gt;andWhere('u.nom like :chaine')
          -&gt;orWhere('u.prenom like :chaine')
          -&gt;orWhere('u.email like :chaine')
          -&gt;orWhere('u.societe like :chaine')
          -&gt;orderBy('u.id')
          -&gt;setParameter('chaine','%'.$chaine.'%')
          -&gt;getQuery()
          -&gt;getResult();
  }</code></pre>
  </div>
  </div>
  </p>