public function getTodosAction() { $data = ['todos' => $this->getDoctrine()->getRepository('AcmeDemoBundle:Todo')->findAll()]; $view = $this->view($data, 200)->setTemplate('AcmeDemoBundle:Todo:getTodos.html.twig'); return $this->handleView($view); }