Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

M3 - Config event subscriber needs an update in dev docs #160

Open
dennisameling opened this issue Jul 9, 2020 · 0 comments
Open

M3 - Config event subscriber needs an update in dev docs #160

dennisameling opened this issue Jul 9, 2020 · 0 comments

Comments

@dennisameling
Copy link
Member

dennisameling commented Jul 9, 2020

This page in the docs explains how plugins can hook into Mautic's configuration section in the UI. The function onConfigGenerate() is key here. In Mautic 3, the way this is done has been changed, so we need to update the docs. All details about how it should be in M3 can be found in UPGRADE-3.0.md.

In short, for Mautic 2.x it was:

public function onConfigGenerate(ConfigBuilderEvent $event)
{
    $event->addForm([
        'bundle'     => 'EmailBundle',
        'formAlias'  => 'emailconfig',
        'formTheme'  => 'MauticEmailBundle:FormTheme\Config',
        'parameters' => $event->getParametersFromConfig('MauticEmailBundle'),
    ]);
}

... now it should be something like (note formType was added):

public function onConfigGenerate(ConfigBuilderEvent $event)
{
    $event->addForm([
        'bundle'     => 'EmailBundle',
        'formType'   => ConfigType::class,
        'formAlias'  => 'emailconfig',
        'formTheme'  => 'MauticEmailBundle:FormTheme\Config',
        'parameters' => $event->getParametersFromConfig('MauticEmailBundle'),
    ]);
}

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant