function TaxonomyController::termTitle

Same name in other branches
  1. 9 core/modules/taxonomy/src/Controller/TaxonomyController.php \Drupal\taxonomy\Controller\TaxonomyController::termTitle()
  2. 8.9.x core/modules/taxonomy/src/Controller/TaxonomyController.php \Drupal\taxonomy\Controller\TaxonomyController::termTitle()
  3. 11.x core/modules/taxonomy/src/Controller/TaxonomyController.php \Drupal\taxonomy\Controller\TaxonomyController::termTitle()

Route title callback.

Parameters

\Drupal\taxonomy\TermInterface $taxonomy_term: The taxonomy term.

Return value

array The term label as a render array.

2 string references to 'TaxonomyController::termTitle'
forum.routing.yml in core/modules/forum/forum.routing.yml
core/modules/forum/forum.routing.yml
taxonomy.routing.yml in core/modules/taxonomy/taxonomy.routing.yml
core/modules/taxonomy/taxonomy.routing.yml

File

core/modules/taxonomy/src/Controller/TaxonomyController.php, line 38

Class

TaxonomyController
Provides route responses for taxonomy.module.

Namespace

Drupal\taxonomy\Controller

Code

public function termTitle(TermInterface $taxonomy_term) {
    return [
        '#markup' => $taxonomy_term->getName(),
        '#allowed_tags' => Xss::getHtmlTagList(),
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.