function party_hat_field_formatter_view in Party 7
Same name and namespace in other branches
- 8.2 modules/party_hat/party_hat.module \party_hat_field_formatter_view()
Implements hook_field_formatter_view().
File
- modules/
party_hat/ party_hat.module, line 673 - party_hat.module Provides an extensible access system for parties.
Code
function party_hat_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
switch ($display['type']) {
case 'hat_reference_default':
foreach ($items as $delta => $item) {
$hat = party_hat_load($item['hat_name']);
$element[$delta]['#markup'] = $hat->label;
}
break;
}
return $element;
}