You are here

public function BarcodeWidget::getPlaceholder in Barcode 8

Get the placeholder for the current type of barcode or custom placeholder.

Parameters

string $type: The current type.

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

File

src/Plugin/Field/FieldWidget/BarcodeWidget.php, line 113

Class

BarcodeWidget
Defines the 'barcode' field widget.

Namespace

Drupal\barcode\Plugin\Field\FieldWidget

Code

public function getPlaceholder($type, $item) {
  if (!($placeholder = $this
    ->getSettings('custom_placeholder'))) {
    $placeholder = $item->types[$type]['placeholder'];
  }
  return $placeholder;
}