You are here

public function TweetbuttonWidget::settingsSummary in Tweet Button 8

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

lib/Drupal/tweetbutton/Plugin/Field/FieldWidget/TweetbuttonWidget.php, line 51
Contains \Drupal\tweetbutton\Plugin\Field\FieldWidget\TweetbuttonWidget.

Class

TweetbuttonWidget
Plugin implementation of the 'tweetbutton' widget.

Namespace

Drupal\tweetbutton\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = array();
  $placeholder = $this
    ->getSetting('placeholder');
  if (!empty($placeholder)) {
    $summary[] = t('Placeholder: @placeholder', array(
      '@placeholder' => $placeholder,
    ));
  }
  else {
    $summary[] = t('No placeholder');
  }
  return $summary;
}