TermViewBuilder.php in Zircon Profile 8.0
Same filename and directory in other branches
Contains \Drupal\taxonomy\TermViewBuilder.
Namespace
Drupal\taxonomyFile
core/modules/taxonomy/src/TermViewBuilder.phpView source
<?php
/**
* @file
* Contains \Drupal\taxonomy\TermViewBuilder.
*/
namespace Drupal\taxonomy;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityViewBuilder;
/**
* Render controller for taxonomy terms.
*/
class TermViewBuilder extends EntityViewBuilder {
/**
* {@inheritdoc}
*/
protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
parent::alterBuild($build, $entity, $display, $view_mode);
$build['#contextual_links']['taxonomy_term'] = array(
'route_parameters' => array(
'taxonomy_term' => $entity
->id(),
),
'metadata' => array(
'changed' => $entity
->getChangedTime(),
),
);
}
}
Classes
Name | Description |
---|---|
TermViewBuilder | Render controller for taxonomy terms. |