public function sio__vocabulary_formatter::view

3.x sio__vocabulary_formatter.inc public sio__vocabulary_formatter::view(&$element, $entity_type, $entity, $langcode, $items, $display)

Overrides TripalFieldFormatter::view

See also

TripalFieldFormatter::view()

File

tripal_chado/includes/TripalFields/sio__vocabulary/sio__vocabulary_formatter.inc, line 14

Class

sio__vocabulary_formatter

Code

public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
  if (count($items) > 0) {
    // The cardinality of this field is 1 so we don't have to
    // iterate through the items array, as there will never be more than 1.
    $element[0] = array(
      '#type' => 'markup',
      '#markup' => $items[0]['value'],
    );
  }
}