src/Http/ErrorHandling/Response/NotFoundHandler.php
private function generateTemplateResponse(
        Renderer $renderer,
        ServerRequestInterface $request
    ) : ResponseInterface {
        $response = ($this->responseFactory)()->withStatus(StatusCodeInterface::STATUS_NOT_FOUND);
        $response->getBody()->write(
            $renderer->render($this->template, ['request' => $request])
        );

        return $response;
    }
private function generateTemplateResponse(
        Renderer $renderer,
        ServerRequestInterface $request
    ) : ResponseInterface {
        $response = ($this->responseFactory)()->withStatus(StatusCodeInterface::STATUS_NOT_FOUND);
        $response->getBody()->write(
            $renderer->render($this->template, ['request' => $request])
        );

        return $response;
    }
private function generateTemplateResponse ( Renderer $ renderer , ServerRequestInterface $ request ) : ResponseInterface { $ response = ( $ this -> responseFactory ) ( ) -> withStatus ( StatusCodeInterface :: STATUS_NOT_FOUND ) ; $ response -> getBody ( ) -> write ( $ renderer -> render ( $ this -> template , [ 'request' => $ request ] ) ) ; return $ response ; }
Generates a response using a template.

Template will receive the current request via the "request" variable.
@param Renderer $renderer
@param ServerRequestInterface $request
@return ResponseInterface
Generates a response using a template .