function taxonomy_test_entity_view

Implements hook_entity_view().

File

drupal/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module, line 78
Test module for Taxonomy hooks and functions not used in core.

Code

function taxonomy_test_entity_view($entity, $view_mode, $langcode) {
  if ($entity
    ->entityType() == 'taxonomy_term' && $view_mode == 'full') {
    $entity->content['taxonomy_test_entity_view_check'] = array(
      '#prefix' => '<div>',
      '#markup' => t('The antonym is %antonym', array(
        '%antonym' => $entity->antonym,
      )),
      '#suffix' => '</div>',
      '#weight' => 20,
    );
  }
}