Skip to content

Commit 9ed1930

Browse files
committed
Updated Readme to include non-slim projects
1 parent 2e25cde commit 9ed1930

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

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)