You are here

public function FieldWidgetComponent::settingsForm in Flexiform 8

Get the settings form.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Overrides FormComponentBase::settingsForm

File

src/Plugin/FormComponentType/FieldWidgetComponent.php, line 201

Class

FieldWidgetComponent
Component class for field widgets.

Namespace

Drupal\flexiform\Plugin\FormComponentType

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $plugin = $this
    ->getRenderer();
  if ($plugin) {

    // Generate the settings form and allow other modules to alter it.
    $settings_form = $plugin
      ->settingsForm($form, $form_state);
    $third_party_settings_form = $this
      ->thirdPartySettingsForm($form, $form_state);
    if ($settings_form || $third_party_settings_form) {
      return [
        'settings' => $settings_form,
        'third_party_settings' => $third_party_settings_form,
      ];
    }
  }
  return [];
}