You are here

public function FieldWidgetComponent::settingsSummary in Flexiform 8

Get the settings summary.

Return value

string The setting summary.

Overrides FormComponentBase::settingsSummary

File

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

Class

FieldWidgetComponent
Component class for field widgets.

Namespace

Drupal\flexiform\Plugin\FormComponentType

Code

public function settingsSummary() {
  $summary = [];
  if ($plugin = $this
    ->getRenderer()) {
    $summary = $plugin
      ->settingsSummary();
  }
  $context = [
    'widget' => $plugin,
    'field_definition' => $this
      ->getFieldDefinition(),
    'form_mode' => $this
      ->getFormDisplay()
      ->getMode(),
  ];
  $this->moduleHandler
    ->alter('field_widget_settings_summary', $summary, $context);
  if ($plugin && ($field_def = $plugin
    ->getThirdPartySetting('flexiform', 'field_definition'))) {
    if (!empty($field_def['label'])) {
      $summary[] = t('Label override: @label', [
        '@label' => $field_def['label'],
      ]);
    }
  }
  return $summary;
}