Bonjour a tous!!

Voila je développe sur Symfony et je suis heurté par un problème. J'ai une page ou j'affiche les membres inscrit et j'ai ajouté une zone de texte dans laquelle on entre le début d'un nom et il doit m'afficher que les membres qui commencent par ce que j'ai saisie dans la zone de texte. Mais le problème c'est que je n'arrive pas à récupérer ce que je tape dans mon champ text de mon html.twig et l'envoyer dans mon controller pour le traitement.

Voici mon controller:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public function rechercheInscritAction(Request $request) 
	    {                 
	     $recherche=$request->get('recherche');
 
         // je vérifie si elle est de type POST
 
 if($requete->getMethod() == 'POST'){
	        $repository = $this->getDoctrine()
                           ->getEntityManager()
                           ->getRepository('ProjetbibliothequeBundle:Inscrit');
        $listeinscrit = $repository->findByNomApproximatif($requete);
 
        return $this->render('ProjetbibliothequeBundle:Inscrit:index.html.twig', array(
            'entities' => $listeinscrit,
        ));}*/
	    }
Voici la vu ou j'ai tout mes inscrits et ou je voudrai afficher le résultat de ma recherche:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{% extends '::base.html.twig' %}
 
{% block body -%}
    <h1>Inscrit list</h1>
 
    <form action="" method="post"> 
      <label for="recherche">Recherche:</label> 
      <input type="text" id="recherche" name="_recherche"  /> 
 
      <button type="submit">Rechercher</button> 
    </form> 
 
    <table class="records_list">
        <thead>
            <tr>
                <th>Id</th>
                <th>Username</th>
                <th>Prenom</th>
                <th>Faculte</th>
                <th>Cycle</th>
                <th>Password</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <td><a href="{{ path('inscrit_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
                <td>{{ entity.username }}</td>
                <td>{{ entity.prenom }}</td>
                <td>{{ entity.faculte }}</td>
                <td>{{ entity.cycle }}</td>
                <td>{{ entity.password }}</td>
                <td>
                <ul>
                    <li>
                        <a href="{{ path('inscrit_show', { 'id': entity.id }) }}">show</a>
                    </li>
                    <li>
                        <a href="{{ path('inscrit_edit', { 'id': entity.id }) }}">edit</a>
                    </li>
                </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
 
        <ul>
        <li>
            <a href="{{ path('inscrit_new') }}">
                Create a new entry
            </a>
        </li>
    </ul>
    {% endblock %}
Et enfin ma fonction de recherche que j'utilise et qui se situe dans mon entity repository:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
 
namespace Projet\bibliothequeBundle\Entity;
 
use Doctrine\ORM\EntityRepository;
 
/**
 * InscritRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class InscritRepository extends EntityRepository
{
 
    public function findByNomApproximatif($username) {
    $queryBuider = $this->createQueryBuilder('s');
    $queryBuider->where('s.username LIKE :username')
         ->setParameter('username', '%'.$username.'%');
 
    return $queryBuider->getQuery()->getResult();
  }
}
Voila si quelqu'un peut m'aider je l'en remercie d'avance .