Skip to content

Commit c6efdc2

Browse files
committed
Merge branch 'geggleto-fix-readme'
Closes #4
2 parents ffaf25a + 9ed1930 commit c6efdc2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
## Usage
5+
## Usage With Slim 3
66

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

23+
## Usage with any PSR-7 Project
24+
```php
25+
//Construct the View
26+
$phpView = new PhpRenderer("./path/to/templates");
27+
28+
//Render a Template
29+
$response = $phpView->render(new Response(), "/path/to/template.php", $yourData);
30+
```
31+
2332
## Exceptions
2433
`\RuntimeException` - if template does not exist
2534

0 commit comments

Comments
 (0)