private function MenuTree::buildMenyTreeHeader in Taxonomy Facets 8
1 call to MenuTree::buildMenyTreeHeader()
File
- src/
MenuTree.php, line 100
Class
Namespace
Drupal\taxonomy_facetsCode
private function buildMenyTreeHeader() {
if ($this->termSelected) {
$termObj = (object) [
'name' => $this->termSelected
->getName(),
];
$termObj->tid = $this->termSelected
->id();
$termObj->vid = $this->termSelected
->getVocabularyId();
$headItem = new MenuLeaf($termObj);
// remove current filter from the url
$headItem->linkUrl = str_replace('/' . $headItem->urlAlias, "", $headItem->linkUrl);
$this->menuTree[] = [
'#theme' => 'taxonomy_facets_remove_filter_template',
'#menuHed' => $headItem,
];
}
}