You are here

function vat_number_field_formatter_view in VAT Number 7

Implements hook_field_formatter_view().

File

./vat_number.module, line 75
Define a VAT Number field for use on Drupal Commerce Customer Profiles.

Code

function vat_number_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  switch ($display['type']) {

    // This formatter simply outputs the field as text.
    case 'vat_number_formatter':
      foreach ($items as $delta => $item) {
        $element[$delta] = array(
          '#markup' => $item['value'],
        );
      }
      break;
  }
  return $element;
}