Skip to content

Commit

Permalink
Merge branch 'geggleto-fix-readme'
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
akrabat committed Oct 16, 2015
2 parents ffaf25a + 9ed1930 commit c6efdc2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a renderer for rendering PHP view scripts into a PSR-7 Response object. It works well with Slim Framework 3.

## Usage
## Usage With Slim 3

```php
use Slim\Views\PhpRenderer;
Expand All @@ -20,6 +20,15 @@ $app->get('/hello/{name}', function ($request, $response, $args) {
$app->run();
```

## Usage with any PSR-7 Project
```php
//Construct the View
$phpView = new PhpRenderer("./path/to/templates");

//Render a Template
$response = $phpView->render(new Response(), "/path/to/template.php", $yourData);
```

## Exceptions
`\RuntimeException` - if template does not exist

Expand Down

0 comments on commit c6efdc2

Please sign in to comment.