You are here

private function HierarchicalTaxonomyMenuBlock::getCurrentRoute in Hierarchical Taxonomy Menu 8

Gets current route.

1 call to HierarchicalTaxonomyMenuBlock::getCurrentRoute()
HierarchicalTaxonomyMenuBlock::build in src/Plugin/Block/HierarchicalTaxonomyMenuBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/HierarchicalTaxonomyMenuBlock.php, line 731

Class

HierarchicalTaxonomyMenuBlock
Provides a 'HierarchicalTaxonomyMenuBlock' block.

Namespace

Drupal\hierarchical_taxonomy_menu\Plugin\Block

Code

private function getCurrentRoute() {
  if ($term_id = $this->currentRouteMatch
    ->getRawParameter('taxonomy_term')) {
    return $term_id;
  }
  return NULL;
}