diff --git a/README.md b/README.md index 0e16471..56b17c5 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,6 @@ This is a renderer for rendering PHP view scripts into a PSR-7 Response object. Note that PHP-View has no built-in mitigation from XSS attacks. It is the developer's responsibility to use `htmlspecialchars()` or a component like [zend-escaper](https://github.com/zendframework/zend-escaper). Alternatively, consider [Twig-View](https://github.com/slimphp/Twig-View). - -## Templates -You may use `$this` inside your php templates. `$this` will be the actual PhpRenderer object will allow you to render sub-templates - ## Installation Install with [Composer](http://getcomposer.org): @@ -49,7 +45,6 @@ $response = $phpView->render(new Response(), "hello.php", $yourData); ``` ## Template Variables - You can now add variables to your renderer that will be available to all templates you render. ```php @@ -81,6 +76,9 @@ $phpView->render($response, $template, [ // In the view above, the $title will be "My Title" and not "Title" ``` +## Sub-templates +Inside your templates you may use `$this` to refer to the PhpRenderer object to render sub-templates. + ## Rendering in Layouts You can now render view in another views called layouts, this allows you to compose modular view templates and help keep your views DRY.