You are here

public static function DoubleField::defaultSettings in Double Field 8.3

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

2 calls to DoubleField::defaultSettings()
TestBase::createField in tests/src/FunctionalJavascript/TestBase.php
Creates a field.
TestBase::saveWidgetSettings in tests/src/Functional/TestBase.php
Saves widget settings.

File

src/Plugin/Field/FieldWidget/DoubleField.php, line 28

Class

DoubleField
Plugin implementation of the 'double_field' widget.

Namespace

Drupal\double_field\Plugin\Field\FieldWidget

Code

public static function defaultSettings() {
  foreach ([
    'first',
    'second',
  ] as $subfield) {
    $settings[$subfield] = [
      // As this method is static there is no way to set an appropriate type
      // for the subwidget. Let self::getSettings() do it instead.
      'type' => NULL,
      'label_display' => 'block',
      'prefix' => '',
      'suffix' => '',
      'size' => 10,
      'placeholder' => '',
      'label' => t('Ok'),
      'cols' => 10,
      'rows' => 5,
    ];
  }
  $settings['inline'] = FALSE;
  return $settings + parent::defaultSettings();
}