예제 #1
0
 /**
  * Renders the exception panel stylesheet for the given token.
  *
  * @param string $token The profiler token
  *
  * @return Response A Response instance
  */
 public function cssAction($token)
 {
     $this->profiler->disable();
     $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
     $template = $this->getTemplate();
     if (!$this->templateExists($template)) {
         $handler = new ExceptionHandler();
         return new Response($handler->getStylesheet($exception));
     }
     return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'));
 }
예제 #2
0
 /**
  * Renders the exception panel stylesheet for the given token.
  *
  * @param string $token The profiler token
  *
  * @return Response A Response instance
  */
 public function cssAction($token)
 {
     if (null === $this->profiler) {
         throw new NotFoundHttpException('The profiler must be enabled.');
     }
     $this->profiler->disable();
     $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();
     $template = $this->getTemplate();
     if (!$this->templateExists($template)) {
         $handler = new ExceptionHandler();
         return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
     }
     return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css'));
 }