i have done a function in repository file
public function FindAllPersonalsOfSupervisor($parameter) {
return $this
->createQueryBuilder('u')
->where('u.parent = :id')
->setParameter('id', $parameter)
->getQuery()
->getResult()
;
}
it works fine and in the controller when i do the dump($listPersonals) i have my result very well and what i want but when i do the render function i have this error :
Variable "listPersonals" does not exist in HRBundle:personalmanagementinfo:personal_list.html.twig at line 50
public function indexAction() {
//récupération du repository
$repository = $this
->getDoctrine()
->getManager()
->getRepository('AuthenticationBundle:User')
;
$user = $this->getUser();
// On récupère la liste des personnels de l'utilisateur authentifié
$listPersonals = $repository->FindAllPersonalsOfSupervisor($user);
//dump($listPersonals);
//die();
return $this->render('HRBundle:personalmanagementinfo:personal_list.html.twig', array(
'user' => $user,
'listPersonals', $listPersonals
));
}
my twig is :
{% for listPersonal in listPersonals %}
<tr>
<td>{{ listPersonal.lastname }} {{ listPersonal.firstname }}</td>
<td>{{ listPersonal.email }}</td>
<td>{{ listPersonal.telephone }}</td>
<td></td>
</tr>
{% endfor %}
i don't see the problem plz help me