public function field_timer_text_base::renderItems in Field Timer 7.2
Render field items.
Parameters
@see hook_field_formatter_view().:
Return value
array Drupal renderable array.
Overrides field_timer_formatter_interface::renderItems
1 call to field_timer_text_base::renderItems()
- field_timer_text_date_field_base::renderItems in includes/
field_timer_text.inc - @inheritdoc
1 method overrides field_timer_text_base::renderItems()
- field_timer_text_date_field_base::renderItems in includes/
field_timer_text.inc - @inheritdoc
File
- includes/
field_timer_text.inc, line 103 - Contains help classes to perform field_timer_text formatter related actions.
Class
- field_timer_text_base
- Base class for field_timer_text formatter.
Code
public function renderItems($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$elements = array();
$settings = $display['settings'];
$granularity_option = $settings['granularity_' . $settings['granularity_type']];
foreach ($items as $delta => $item) {
$elements[$delta] = array(
'#type' => 'markup',
'#markup' => $this
->renderItem($settings['type'], $settings['granularity_type'], $granularity_option, $this
->getTimestamp($item, $field)),
);
}
return $elements;
}