Exemplo n.º 1
0
 /**
  * Converts a Request object into a Response object.
  *
  * @param RequestInterface $request
  * @return ResponseInterface
  */
 public function handle(RequestInterface $request)
 {
     try {
         return $this->doHandle($request);
     } catch (RouteNotFoundException $e) {
         $exception = $e;
         //return $this->renderer->renderResponse("errors/404.php", compact("request","exception"),Response::HTTP_NOT_FOUND);
         //return $this->renderer->renderResponse("errors/404.tpl", compact("request","exception"),Response::HTTP_NOT_FOUND);
         return $this->renderer->renderResponse("errors/404.twig", compact("request", "exception"), Response::HTTP_NOT_FOUND);
     } catch (MethodNotAllowedException $e) {
         return $this->createResponse($request, 'Method Not Allowed', Response::HTTP_METHOD_NOT_ALLOWED);
     } catch (\Exception $e) {
         return $this->createResponse($request, 'Internal Server Error', Response::HTTP_INTERNAL_SERVER_ERROR);
     }
 }
 /**
  * @param $view
  * @param array $params
  * @return mixed
  */
 protected function render($view, array $params)
 {
     return $this->renderer->renderResponse($view, $params);
 }