Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function renderTemplate(Plates\Template $template, Plates\RenderTemplate $rt = null) { |
||
10 | $ref = $template->reference; |
||
11 | $content = $this->render->renderTemplate($template, $rt ?: $this); |
||
12 | |||
13 | $layout_ref = $ref()->get('layout'); |
||
14 | if (!$layout_ref) { |
||
15 | return $content; |
||
16 | } |
||
17 | |||
18 | $layout = $layout_ref()->with('sections', $ref()->get('sections')); |
||
19 | $layout->get('sections')->add('content', $content); |
||
20 | |||
21 | return ($rt ?: $this)->renderTemplate($layout); |
||
22 | } |
||
23 | } |
||
26 |