Skip to content

Commit ae8b322

Browse files
authored
Document improved sub-templte workflow
1 parent cb289bb commit ae8b322

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ $phpView->render($response, $template, [
7777
```
7878

7979
## Sub-templates
80-
Inside your templates you may use `$this` to refer to the PhpRenderer object to render sub-templates.
80+
Inside your templates you may use `$this` to refer to the PhpRenderer object to render sub-templates. If using a layout the `fetch()` method can be used instead of `render()` to avoid appling the layout to the sub-template.
81+
82+
```phtml
83+
<?=$this->fetch('./path/to/partial.phtml', ["name" => "John"])?>
84+
```
8185

8286
## Rendering in Layouts
8387
You can now render view in another views called layouts, this allows you to compose modular view templates

0 commit comments

Comments
 (0)