You are here

function postal_code_field_formatter_view in Postal Code 7

Implements hook_field_formatter_view().

File

./postal_code.module, line 260

Code

function postal_code_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  switch ($display['type']) {
    case 'postal_code_simple_text':
      foreach ($items as $delta => $item) {
        $element[$delta] = array(
          '#markup' => check_plain($item['postal']),
        );
      }
      break;
  }
  return $element;
}