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