English (United Kingdom)

public function getForm() : array

Returns the configuration fields of the action.


Description

This method is used to define the list of fields used by the configuration of the action.

The array to return should look like the following JSON representation.

{
    "param_1": {
        "type": "text",
        "value": "abc",
        "label": "Text Field"
    },
    "param_2": {
        "type": "select",
        "value": "one",
        "label": "Dropdown",
        "options": {
            "one": "One",
            "two": "Two",
            "three": "Three"
        }
    }
}

 Further details about all the supported fields can be found HERE.


 Return Value

Array. An associative array containing the configuration form of the conditional text action.


Example

The example below explains how to support the fields mentioned in the article used to describe the apply method.

/**
 * @inheritDoc
 */
public function getForm()
{
    return [
        'sendermail' => [
            'type'  => 'email',
            'label' => __('Sender e-mail', 'myplugin'),
            'value' => $this->options->get('sendermail'),
        ],
        'sendername' => [
            'type'  => 'text',
            'label' => __('Sender name', 'myplugin'),
            'value' => $this->options->get('sendername'),
        ],
        'replyto' => [
            'type'  => 'email',
            'label' => __('Reply-to e-mail', 'myplugin'),
            'value' => $this->options->get('replyto'),
        ],
    ];
}
Last Update: 2023-12-21
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.