You are here

public function FormElementBaseTrait::settingsForm in Flexiform 8

File

src/FormElement/FormElementBaseTrait.php, line 17

Class

FormElementBaseTrait
Trait for basic form element things.

Namespace

Drupal\flexiform\FormElement

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['settings'] = [
    '#type' => 'container',
  ];
  $form['settings']['label'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Label'),
    '#description' => $this
      ->t('The label that will be displayed on the form.'),
    '#default_value' => !empty($this->configuration['label']) ? $this->configuration['label'] : '',
  ];
  return $form;
}