You are here

public function TextFieldCounterWidgetTrait::addPositionSummary in Textfield Counter 8

Adds the summary of the position of the textfield counter.

Parameters

array $summary: The array of summaries to which the summary should be added.

5 calls to TextFieldCounterWidgetTrait::addPositionSummary()
StringTextareaWithCounterWidget::settingsSummary in src/Plugin/Field/FieldWidget/StringTextareaWithCounterWidget.php
Returns a short summary for the current widget settings.
StringTextfieldWithCounterWidget::settingsSummary in src/Plugin/Field/FieldWidget/StringTextfieldWithCounterWidget.php
Returns a short summary for the current widget settings.
TextareaWithCounterWidget::settingsSummary in src/Plugin/Field/FieldWidget/TextareaWithCounterWidget.php
Returns a short summary for the current widget settings.
TextareaWithSummaryAndCounterWidget::settingsSummary in src/Plugin/Field/FieldWidget/TextareaWithSummaryAndCounterWidget.php
Returns a short summary for the current widget settings.
TextfieldWithCounterWidget::settingsSummary in src/Plugin/Field/FieldWidget/TextfieldWithCounterWidget.php
Returns a short summary for the current widget settings.

File

src/Plugin/Field/FieldWidget/TextFieldCounterWidgetTrait.php, line 236

Class

TextFieldCounterWidgetTrait
Textfield counter trait. Adds textfield counting functionality.

Namespace

Drupal\textfield_counter\Plugin\Field\FieldWidget

Code

public function addPositionSummary(array &$summary) {
  if ($this
    ->getSetting('maxlength') || $this
    ->getSetting('use_field_maxlength')) {
    $summary['counter_position'] = $this
      ->t('Counter position: %position', [
      '%position' => $this
        ->translateValue($this
        ->getSetting('counter_position')),
    ]);
  }
}