vendor/symfony/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Symfony package.
       
     5  *
       
     6  * (c) Fabien Potencier <fabien@symfony.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Symfony\Bundle\WebProfilerBundle\Controller;
       
    13 
       
    14 use Symfony\Component\DependencyInjection\ContainerAware;
       
    15 use Symfony\Component\HttpKernel\Exception\FlattenException;
       
    16 use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
       
    17 use Symfony\Component\HttpFoundation\Response;
       
    18 use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController;
       
    19 
       
    20 /**
       
    21  * ExceptionController.
       
    22  *
       
    23  * @author Fabien Potencier <fabien@symfony.com>
       
    24  */
       
    25 class ExceptionController extends BaseExceptionController
       
    26 {
       
    27     /**
       
    28      * {@inheritdoc}
       
    29      */
       
    30     public function showAction(FlattenException $exception, DebugLoggerInterface $logger = null, $format = 'html')
       
    31     {
       
    32         $template = $this->container->get('kernel')->isDebug() ? 'exception' : 'error';
       
    33         $code = $exception->getStatusCode();
       
    34 
       
    35         return $this->container->get('templating')->renderResponse(
       
    36             'TwigBundle:Exception:'.$template.'.html.twig',
       
    37             array(
       
    38                 'status_code'    => $code,
       
    39                 'status_text'    => Response::$statusTexts[$code],
       
    40                 'exception'      => $exception,
       
    41                 'logger'         => null,
       
    42                 'currentContent' => '',
       
    43             )
       
    44         );
       
    45     }
       
    46 }