diff --git a/best_practices/controllers.rst b/best_practices/controllers.rst index 369d7be4e4c..b89b302e212 100644 --- a/best_practices/controllers.rst +++ b/best_practices/controllers.rst @@ -110,8 +110,9 @@ for the homepage of our app: */ public function indexAction() { - $em = $this->getDoctrine()->getManager(); - $posts = $em->getRepository('App:Post')->findLatest(); + $posts = $this->getDoctrine() + ->getRepository('AppBundle:Post') + ->findLatest(); return $this->render('default/index.html.twig', array( 'posts' => $posts