1 | <?php |
||
24 | final class RenderBlockExtension extends \Twig_Extension |
||
25 | { |
||
26 | const TEXT_BLOCK_TEMPLATE = '@BitBagCmsPlugin/Shop/Block/textBlock.html.twig'; |
||
27 | const HTML_BLOCK_TEMPLATE = '@BitBagCmsPlugin/Shop/Block/htmlBlock.html.twig'; |
||
28 | const IMAGE_BLOCK_TEMPLATE = '@BitBagCmsPlugin/Shop/Block/imageBlock.html.twig'; |
||
29 | |||
30 | /** |
||
31 | * @var BlockRepositoryInterface |
||
32 | */ |
||
33 | private $blockRepository; |
||
34 | |||
35 | /** |
||
36 | * @var LoggerInterface |
||
37 | */ |
||
38 | private $logger; |
||
39 | |||
40 | /** |
||
41 | * @param BlockRepositoryInterface $blockRepository |
||
42 | * @param LoggerInterface $logger |
||
43 | */ |
||
44 | public function __construct( |
||
52 | |||
53 | /** |
||
54 | * @return \Twig_SimpleFunction[] |
||
55 | */ |
||
56 | public function getFunctions(): array |
||
62 | |||
63 | /** |
||
64 | * @param \Twig_Environment $twigEnvironment |
||
65 | * @param string $code |
||
66 | * |
||
67 | * @return null|string |
||
68 | * @throws TemplateTypeNotFound |
||
69 | */ |
||
70 | public function renderBlock(\Twig_Environment $twigEnvironment, $code): ?string |
||
97 | } |