You are here

public function ExtraFieldPlusDisplayBase::getSettingsForm in Extra Field Settings Provider 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ExtraFieldPlusDisplayBase.php \Drupal\extra_field_plus\Plugin\ExtraFieldPlusDisplayBase::getSettingsForm()

Returns field settings form.

Return value

array The field settings form. Example: [key_1 => [...], key_2 => [...], ...].

Overrides ExtraFieldPlusDisplayInterface::getSettingsForm

File

src/Plugin/ExtraFieldPlusDisplayBase.php, line 58

Class

ExtraFieldPlusDisplayBase
Base class for Extra field Plus Display plugins.

Namespace

Drupal\extra_field_plus\Plugin

Code

public function getSettingsForm() {
  $default_values = (array) $this
    ->getDefaultFormValues();
  $elements = (array) $this
    ->settingsForm();
  if (!empty($elements)) {
    foreach ($elements as $name => &$element) {
      $element['#default_value'] = isset($default_values[$name]) ? $default_values[$name] : '';
    }
  }
  return $elements;
}