public function PdfPages::settingsSummary in PDF 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 FormatterBase::settingsSummary
File
- src/
Plugin/ Field/ FieldFormatter/ PdfPages.php, line 35
Class
- PdfPages
- Plugin annotation @FieldFormatter( id = "pdf_pages", label = @Translation("PDF: Continuous scroll (experimental)"), description = @Translation("Don't use this to display big PDF file."), field_types = {"file"} )
Namespace
Drupal\pdf\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = [];
$scale = $this
->getSetting('scale');
if (empty($scale)) {
$summary[] = $this
->t('No settings');
}
else {
$summary[] = t('Scale: @scale', [
'@scale' => $scale,
]);
}
return $summary;
}