You are here

function machine_name_field_formatter_view in Machine name 7.2

Same name and namespace in other branches
  1. 7 machine_name.module \machine_name_field_formatter_view()

Implements hook_field_formatter_view().

File

./machine_name.module, line 115
Defines a machine name field type, relying on Form API's #type 'machine_name'.

Code

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