You are here

function node_field_node_field_formatter in Node Field 7.2

Get node field formatter.

Parameters

array $node_field: Node field to get renderable view array for.

1 call to node_field_node_field_formatter()
node_field_node_content_add_node_fields in includes/node_field.api.inc
Get render array of node fields.

File

includes/node_field.field.inc, line 166
Field types, settings, widget and formatters.

Code

function node_field_node_field_formatter(array $node_field) {
  $node_field_types = node_field_types_info();
  $function = isset($node_field_types[$node_field['type']]['formatter']) ? $node_field_types[$node_field['type']]['formatter'] : FALSE;
  if ($function && is_callable($function)) {
    $value = $function($node_field);
    drupal_alter('node_field_formatter', $node_field, $value);
    $node_field['value'] = $value;
  }
  return $node_field;
}