src/APIBundle/Controller/DisplayMessageController.php line 16

Open in your IDE?
  1. <?php
  2. namespace APIBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  5. use APIBundle\Entity\City;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. class DisplayMessageController extends Controller
  9. {
  10.     /**
  11.      * @Route("/api/displaymsg/{id}", requirements={"id": "\d+"})
  12.      */
  13.     public function readAction($id)
  14.     {
  15.         $msg $this->getDoctrine()->getRepository("AdminBundle:Message")->findBy(array("id" => $id));
  16.         return new Response($msg[0]->getBody());
  17.     }
  18. }