You are here

public function Link::settingsSummary in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/DsField/Link.php \Drupal\ds\Plugin\DsField\Link::settingsSummary()
  2. 8.3 src/Plugin/DsField/Link.php \Drupal\ds\Plugin\DsField\Link::settingsSummary()

Returns the summary of the chosen settings.

Parameters

array $settings: Contains the settings of the field.

Return value

array A render array containing the summary.

Overrides DsFieldBase::settingsSummary

File

src/Plugin/DsField/Link.php, line 48

Class

Link
Plugin that renders a link.

Namespace

Drupal\ds\Plugin\DsField

Code

public function settingsSummary($settings) {
  $config = $this
    ->getConfiguration();
  $summary = [];
  $summary[] = 'Link text: ' . $config['link text'];
  if (!empty($config['link class'])) {
    $summary[] = 'Link class: ' . $config['link class'];
  }
  if (!empty($config['wrapper'])) {
    $summary[] = 'Wrapper: ' . $config['wrapper'];
  }
  if (!empty($config['class'])) {
    $summary[] = 'Class: ' . $config['class'];
  }
  return $summary;
}