Go to the documentation of this file.00001 <?php
00002
00003 namespace Admingenerated\EtraliGinangBundle\BaseCityController;
00004
00005 use Admingenerator\GeneratorBundle\Controller\Doctrine\BaseController as BaseController;
00006 use Symfony\Component\HttpFoundation\RedirectResponse;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
00007
00008
00009
00010 class ShowController extends BaseController
00011 {
00012 public function indexAction($pk)
00013 {
00014 $City = $this->getObject($pk);
00015
00016
00017
00018 if (!$City) {
00019 throw new NotFoundHttpException("The Etrali\GinangBundle\Entity\City with idCity $pk can't be found");
00020 }
00021
00022 return $this->render('EtraliGinangBundle:CityShow:index.html.twig', array(
00023 "City" => $City
00024 ));
00025 }
00026
00027
00028 protected function getObject($pk)
00029 {
00030 return $this->getDoctrine()
00031 ->getEntityManager()
00032 ->getRepository('Etrali\GinangBundle\Entity\City')
00033 ->find($pk);
00034 }
00035 }