-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathConfigSubscriber.php
32 lines (28 loc) · 1018 Bytes
/
ConfigSubscriber.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace MauticPlugin\LeuchtfeuerPrintmailingBundle\EventListener;
use Mautic\ConfigBundle\ConfigEvents;
use Mautic\ConfigBundle\Event\ConfigBuilderEvent;
use MauticPlugin\LeuchtfeuerPrintmailingBundle\Form\Type\ConfigType;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ConfigSubscriber implements EventSubscriberInterface
{
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
ConfigEvents::CONFIG_ON_GENERATE => ['onConfigGenerate', 0],
];
}
public function onConfigGenerate(ConfigBuilderEvent $event): void
{
$event->addForm([
'bundle' => 'LeuchtfeuerPrintmailingBundle',
'formType' => ConfigType::class,
'formAlias' => 'printmailingconfig',
'formTheme' => 'LeuchtfeuerPrintmailingBundle:FormTheme\Config',
'parameters' => $event->getParametersFromConfig('LeuchtfeuerPrintmailingBundle'),
]);
}
}