function TaxonomyController::vocabularyTitle

Same name in other branches
  1. 8.9.x core/modules/taxonomy/src/Controller/TaxonomyController.php \Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle()

Route title callback.

Parameters

\Drupal\taxonomy\VocabularyInterface $taxonomy_vocabulary: The vocabulary.

Return value

string The vocabulary label as a render array.

Deprecated

in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement; route title callbacks are internal.

See also

https://www.drupal.org/project/drupal/issues/3037157

File

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

Class

TaxonomyController
Provides route responses for taxonomy.module.

Namespace

Drupal\taxonomy\Controller

Code

public function vocabularyTitle(VocabularyInterface $taxonomy_vocabulary) {
    @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement; route title callbacks are internal. See https://www.drupal.org/project/drupal/issues/3037157.', E_USER_DEPRECATED);
    return [
        '#markup' => $taxonomy_vocabulary->label(),
        '#allowed_tags' => Xss::getHtmlTagList(),
    ];
}

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