Skip to content

Commit fe7c762

Browse files
committed
Updated Readme and docblocks
1 parent 11debed commit fe7c762

3 files changed

Lines changed: 32 additions & 19 deletions

File tree

.idea/workspace.xml

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

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## PHP Renderer
2+
3+
14
## Usage
25

36
```php
@@ -13,4 +16,8 @@ $app->get('/hello/{name}', function ($request, $response, $args) {
1316
});
1417

1518
$app->run();
16-
```
19+
```
20+
21+
## Exceptions
22+
`\RuntimeException` - if template does not exist
23+
`\InvalidArgumentException` - if $data contains 'template'

src/PHPRenderer.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@ public function __construct($templatePath = "")
3434
}
3535

3636
/**
37-
* Render
37+
* Render a template
3838
*
39-
* Inserts template into Response object
39+
* $data cannot contain template as a key
40+
*
41+
* throws RuntimeException if $templatePath . $template does not exist
4042
*
4143
* @param \Slim\Http\Response $response
42-
* @param string $template
43-
* @param array $data
44+
* @param $template
45+
* @param array $data
46+
*
4447
* @return \Slim\Http\Response
48+
*
49+
* @throws \InvalidArgumentException
50+
* @throws \RuntimeException
4551
*/
4652
public function render(Response $response, $template, array $data = [])
4753
{

0 commit comments

Comments
 (0)