public function NumberUnformattedFormatter::viewElements

Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().

Overrides FormatterInterface::viewElements

File

drupal/core/modules/number/lib/Drupal/number/Plugin/field/formatter/NumberUnformattedFormatter.php, line 34
Definition of Drupal\number\Plugin\field\formatter\NumberUnformattedFormatter.

Class

NumberUnformattedFormatter
Plugin implementation of the 'number_unformatted' formatter.

Namespace

Drupal\number\Plugin\field\formatter

Code

public function viewElements(EntityInterface $entity, $langcode, array $items) {
  $elements = array();
  foreach ($items as $delta => $item) {
    $elements[$delta] = array(
      '#markup' => $item['value'],
    );
  }
  return $elements;
}