function FieldThirdPartyTestHooks::fieldFormatterThirdPartySettingsForm

Implements hook_field_formatter_third_party_settings_form().

Attributes

#[Hook('field_formatter_third_party_settings_form')]

File

core/modules/field/tests/modules/field_third_party_test/src/Hook/FieldThirdPartyTestHooks.php, line 58

Class

FieldThirdPartyTestHooks
Hook implementations for field_third_party_test.

Namespace

Drupal\field_third_party_test\Hook

Code

public function fieldFormatterThirdPartySettingsForm(FormatterInterface $plugin, FieldDefinitionInterface $field_definition, $view_mode, $form, FormStateInterface $form_state) : array {
  $element['field_test_field_formatter_third_party_settings_form'] = [
    '#type' => 'textfield',
    '#title' => $this->t('3rd party formatter settings form'),
    '#default_value' => $plugin->getThirdPartySetting('field_third_party_test', 'field_test_field_formatter_third_party_settings_form'),
  ];
  return $element;
}

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