entityManager = $entity_manager; $this->config = $config_factory->get('forum.settings'); $this->forumManager = $forum_manager; $this->setStringTranslation($string_translation); } /** * {@inheritdoc} */ public function build(RouteMatchInterface $route_match) { $breadcrumb = new Breadcrumb(); $breadcrumb->addCacheContexts(['route']); $links[] = Link::createFromRoute($this->t('Home'), ''); $vocabulary = $this->entityManager ->getStorage('taxonomy_vocabulary') ->load($this->config->get('vocabulary')); $breadcrumb->addCacheableDependency($vocabulary); $links[] = Link::createFromRoute($vocabulary->label(), 'forum.index'); return $breadcrumb->setLinks($links); } }