I want to save image path to database when I click save button in configuration. Any help?

Hi,

where is the problem? It does exactly that by default IIRC:

Create Form:

        $form->setElement(
            'mediaselection',
            'myMediaSelection',
            array(
                'label' => 'Media',
                'value' => null
            )
        );

Read the path:

Shopware()->Config()->getByNamespace('SwagMyPlugin', 'myMediaSelection');

If this is not what you’ve been loking for, please explain, what is expected and what happens instead and what you did so far. Not always is a picture worth 1000 words :slight_smile:

I am creating a plugin that has a configuration form as you can see in the picture.

In that form I have a media selection field and I will select an image in that field.

Now when I click Save button in configuration form, I want to store the image path of media selection field in my database.

I want to know how can I trigger ‚save configuration‘ button in my bootstrap file and pass the form fields into it?