Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
24 | public function onBlockEvent(BlockEvent $event): void |
||
25 | { |
||
26 | $template = null; |
||
27 | |||
28 | if (null !== $this->slider) { |
||
29 | $template = '@OdiseoSyliusBannerPlugin/Shop/Slider/_'.$this->slider.'_css.html.twig'; |
||
30 | } |
||
31 | |||
32 | if (null !== $template) { |
||
33 | $block = new Block(); |
||
34 | $block->setId(uniqid('', true)); |
||
35 | $block->setSettings(array_replace($event->getSettings(), [ |
||
36 | 'template' => $template, |
||
37 | ])); |
||
38 | $block->setType('sonata.block.service.template'); |
||
39 | |||
40 | $event->addBlock($block); |
||
41 | } |
||
44 |