public function getPagesCountNgAction() { $em = $this->getDoctrine()->getManager(); $response = new Response(json_encode(array("result" => Page::getPagesCount($em)))); $response->headers->set('Content-Type', 'application/json'); return $response; }