function TestItem::fieldSettingsForm

Same name in other branches
  1. 9 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php \Drupal\field_test\Plugin\Field\FieldType\TestItem::fieldSettingsForm()
  2. 10 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php \Drupal\field_test\Plugin\Field\FieldType\TestItem::fieldSettingsForm()
  3. 11.x core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php \Drupal\field_test\Plugin\Field\FieldType\TestItem::fieldSettingsForm()

Overrides FieldItemBase::fieldSettingsForm

File

core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php, line 91

Class

TestItem
Defines the 'test_field' entity field item.

Namespace

Drupal\field_test\Plugin\Field\FieldType

Code

public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
    $form['test_field_setting'] = [
        '#type' => 'textfield',
        '#title' => t('Field test field setting'),
        '#default_value' => $this->getSetting('test_field_setting'),
        '#required' => FALSE,
        '#description' => t('A dummy form element to simulate field setting.'),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.