You are here

protected function RangeWidget::formElementSubElementPrefixSuffix in Range 8

Helper method. Adds prefix/suffix to a range field widget subelements.

Parameters

array $element: Range field widget definition array.

string $element_name: Form element machine name.

1 call to RangeWidget::formElementSubElementPrefixSuffix()
RangeWidget::formElement in src/Plugin/Field/FieldWidget/RangeWidget.php
Returns the form for a single field widget.

File

src/Plugin/Field/FieldWidget/RangeWidget.php, line 167

Class

RangeWidget
Plugin implementation of the 'range' widget.

Namespace

Drupal\range\Plugin\Field\FieldWidget

Code

protected function formElementSubElementPrefixSuffix(array &$element, $element_name) {
  $setting = $this
    ->getFieldSetting($element_name);
  $element[$element_name]['#field_prefix'] = FieldFilteredMarkup::create($setting['prefix']);
  $element[$element_name]['#field_suffix'] = FieldFilteredMarkup::create($setting['suffix']);
}