Conditions | 6 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
16 | 12 | public function renderTemplate(Plates\Template $template, Plates\RenderTemplate $rt = null) { |
|
17 | 12 | if ($template->parent || $template->get('no_layout')) { |
|
18 | 12 | return $this->render->renderTemplate($template, $rt ?: $this); |
|
19 | } |
||
20 | |||
21 | 8 | $ref = $template->reference; |
|
22 | 8 | $contents = $this->render->renderTemplate($template, $rt ?: $this); |
|
23 | |||
24 | 8 | if ($ref()->get('layout')) { |
|
25 | 4 | return $contents; |
|
26 | } |
||
27 | |||
28 | 4 | $layout = $ref()->fork($this->layout_path); |
|
29 | 4 | $ref()->with('layout', $layout->reference); |
|
30 | |||
31 | 4 | return $contents; |
|
32 | } |
||
33 | |||
42 |