<?php
namespace Common\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Debug\Exception\FlattenException;
use \Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
class ExceptionController extends Controller {
public function showExceptionAction(FlattenException $exception, DebugLoggerInterface $logger) {
//dump($exception);dump($logger);die();
switch ($exception->getStatusCode()) {
case 404:
return $this->render('CommonCoreBundle:Exception:404.html.twig', array(
// ...
));
break;
case 403:
return $this->render('CommonCoreBundle:Exception:403.html.twig', array(
// ...
));
break;
case 402:
return $this->render('CommonCoreBundle:Exception:402.html.twig', array(
// ...
));
break;
default:
return $this->render('CommonCoreBundle:Exception:500.html.twig', array(
// ...
));
break;
}
}
}