function static_field_field_formatter_view in Static field 7
Implements hook_field_formatter_view().
File
- ./
static_field.module, line 104 - Static field main module file.
Code
function static_field_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
$item_static = array(
'#markup' => check_markup($instance['settings']['text']['value'], $instance['settings']['text']['format']),
);
foreach ($items as $delta => $item) {
$element[$delta] = $item_static;
}
$element[0] = $item_static;
return $element;
}