Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
19 | 1 | public function render(ServerRequestInterface $request, ViewInterface $view): ResponseInterface |
|
20 | { |
||
21 | // Get new Response with HTML content type |
||
22 | 1 | $response = $this->responseFactory->createResponse()->withHeader('Content-Type', 'text/html; charset=utf-8'); |
|
23 | |||
24 | // Write rendered Twig to body |
||
25 | 1 | $response->getBody()->rewind(); |
|
26 | 1 | $response->getBody()->write($this->twig->render($view->getTemplate(), $view->getParameters())); |
|
27 | 1 | $response->getBody()->rewind(); |
|
28 | |||
29 | 1 | return $response; |
|
30 | } |
||
32 |