I have configure FOSUserBundle and now i want to display all users connected to databse but i don't know how to do it. I need to create method in controller to display the list
public function indexAction()
{
$em = $this->container->get('doctrine')->getManager();
$users = $em->getRepository('RegisterUserBundle:User')->.....
$em->flush();
return $this->container->get('templating')->renderResponse('RegisterUserBundle:Default:index.html.twig',
array('users' => $users
)
);
Can someone help me to resolve this issues and i 'm debutant in symfony.