Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function render(Block $block, string $template, array $parameters = []): string |
||
25 | { |
||
26 | $blockId = $this->getNormalizedId($block); |
||
27 | $template = $this->twig->load($template); |
||
28 | if (false === $template->hasBlock($blockId)) { |
||
29 | throw new TemplateDoesNotContainBlock(); |
||
30 | } |
||
31 | |||
32 | $html = $template->renderBlock($blockId, $parameters); |
||
33 | if (empty($html) && false === $block->shouldRefresh()) { |
||
34 | throw new BlockIsEmpty(); |
||
35 | } |
||
36 | |||
37 | return $html; |
||
38 | } |
||
45 |