src/Common/CoreBundle/Controller/ExceptionController.php line 17

Open in your IDE?
  1. <?php
  2. namespace Common\CoreBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  4. use Symfony\Component\Debug\Exception\FlattenException;
  5. use \Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
  6. class ExceptionController extends Controller {
  7.     public function showExceptionAction(FlattenException $exceptionDebugLoggerInterface $logger) {
  8.         //dump($exception);dump($logger);die();
  9.         switch ($exception->getStatusCode()) {
  10.             case 404:
  11.                 return $this->render('CommonCoreBundle:Exception:404.html.twig', array(
  12.                                 // ...
  13.                 ));
  14.                 break;
  15.             case 403:
  16.                 return $this->render('CommonCoreBundle:Exception:403.html.twig', array(
  17.                                 // ...
  18.                 ));
  19.                 break;
  20.             case 402:
  21.                 return $this->render('CommonCoreBundle:Exception:402.html.twig', array(
  22.                                 // ...
  23.                 ));
  24.                 break;
  25.             default:
  26.                 return $this->render('CommonCoreBundle:Exception:500.html.twig', array(
  27.                                 // ...
  28.                 ));
  29.                 break;
  30.         }
  31.     }
  32. }