You are here

public function TableFormatter::settingsSummary in File Hash 8

Returns a short summary for the current formatter settings.

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

Return value

string[] A short summary of the formatter settings.

Overrides DescriptionAwareFileFormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/TableFormatter.php, line 104

Class

TableFormatter
Plugin implementation of the 'filehash_table' formatter.

Namespace

Drupal\filehash\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $algos = filehash_names();
  if (isset($algos[$this
    ->getSetting('algo')])) {
    $summary[] = $this
      ->t('@algo hash', [
      '@algo' => $algos[$this
        ->getSetting('algo')],
    ]);
  }
  return $summary;
}