protected function TermRenderController::getBuildDefaults

Provides entity-specific defaults to the build process.

Parameters

Drupal\Core\Entity\EntityInterface $entity: The entity for which the defaults should be provided.

string $view_mode: The view mode that should be used.

string $langcode: (optional) For which language the entity should be prepared, defaults to the current content language.

Return value

array

Overrides EntityRenderController::getBuildDefaults

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php, line 40
Definition of Drupal\taxonomy\TermRenderController.

Class

TermRenderController
Render controller for taxonomy terms.

Namespace

Drupal\taxonomy

Code

protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) {
  $return = parent::getBuildDefaults($entity, $view_mode, $langcode);

  // TODO: rename "term" to "taxonomy_term" in theme_taxonomy_term().
  $return['#term'] = $return["#{$this->entityType}"];
  unset($return["#{$this->entityType}"]);
  return $return;
}