Skip to content

Commit

Permalink
PSR-7 Compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
geggleto committed Oct 1, 2015
1 parent 681cdf1 commit e7e5fec
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 33 deletions.
6 changes: 0 additions & 6 deletions .idea/SlimRenderer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 53 additions & 23 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## PHP Renderer
PHP Template Renderer for Slim
PHP Template Renderer for Slim / PSR-7

## Usage

Expand Down
6 changes: 3 additions & 3 deletions src/PHPRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Geggleto\Renderer;

use Slim\Http\Response;
use Psr\Http\Message\ResponseInterface;

/**
* Class SlimRenderer
Expand Down Expand Up @@ -49,7 +49,7 @@ public function __construct($templatePath = "")
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function render(Response $response, $template, array $data = [])
public function render(ResponseInterface $response, $template, array $data = [])
{
if (isset($data['template'])) {
throw new \InvalidArgumentException("Duplicate template key found");
Expand All @@ -65,6 +65,6 @@ public function render(Response $response, $template, array $data = [])
include $this->templatePath . $template;
$output = ob_get_clean();

return $response->write($output);
return $response->getBody()->write($output);
}
}

0 comments on commit e7e5fec

Please sign in to comment.