function FieldThirdPartyTestHooks::fieldWidgetThirdPartySettingsFormAdditionalImplementation

Implements hook_field_widget_third_party_settings_form().

Attributes

#[Hook('field_widget_third_party_settings_form')]

File

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

Class

FieldThirdPartyTestHooks
Hook implementations for field_third_party_test.

Namespace

Drupal\field_third_party_test\Hook

Code

public function fieldWidgetThirdPartySettingsFormAdditionalImplementation(WidgetInterface $plugin, FieldDefinitionInterface $field_definition, $form_mode, $form, FormStateInterface $form_state) : array {
  $number = $this->elementInfoManager
    ->fromClass(Number::class);
  $number->title = $this->t('Second 3rd party widget settings form');
  $number->default_value = $plugin->getThirdPartySetting('field_third_party_test', 'second_field_widget_third_party_settings_form');
  return $number->toRenderable('second_field_widget_third_party_settings_form');
}

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