Skip to content

Commit e7e5fec

Browse files
committed
PSR-7 Compatible
1 parent 681cdf1 commit e7e5fec

4 files changed

Lines changed: 57 additions & 33 deletions

File tree

.idea/SlimRenderer.iml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 53 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## PHP Renderer
2-
PHP Template Renderer for Slim
2+
PHP Template Renderer for Slim / PSR-7
33

44
## Usage
55

src/PHPRenderer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Geggleto\Renderer;
1010

11-
use Slim\Http\Response;
11+
use Psr\Http\Message\ResponseInterface;
1212

1313
/**
1414
* Class SlimRenderer
@@ -49,7 +49,7 @@ public function __construct($templatePath = "")
4949
* @throws \InvalidArgumentException
5050
* @throws \RuntimeException
5151
*/
52-
public function render(Response $response, $template, array $data = [])
52+
public function render(ResponseInterface $response, $template, array $data = [])
5353
{
5454
if (isset($data['template'])) {
5555
throw new \InvalidArgumentException("Duplicate template key found");
@@ -65,6 +65,6 @@ public function render(Response $response, $template, array $data = [])
6565
include $this->templatePath . $template;
6666
$output = ob_get_clean();
6767

68-
return $response->write($output);
68+
return $response->getBody()->write($output);
6969
}
7070
}

0 commit comments

Comments
 (0)