public function RenderCheeseburgerMenuBlock::getAllTaxonomyTermNames in Cheeseburger Menu 8.4
Same name and namespace in other branches
- 8 src/Controller/renderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\renderCheeseburgerMenuBlock::getAllTaxonomyTermNames()
- 8.2 src/Controller/RenderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\RenderCheeseburgerMenuBlock::getAllTaxonomyTermNames()
- 8.3 src/Controller/RenderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\RenderCheeseburgerMenuBlock::getAllTaxonomyTermNames()
Get all taxonomy term names.
File
- src/
Controller/ RenderCheeseburgerMenuBlock.php, line 499 - Controller used for rendering block.
Class
- RenderCheeseburgerMenuBlock
- Class RenderCheeseburgerMenuBlock.
Namespace
Drupal\cheeseburger_menu\ControllerCode
public function getAllTaxonomyTermNames() {
if (!$this
->moduleHandler()
->moduleExists('taxonomy')) {
return [];
}
$all_taxonomies = $this
->entityTypeManager()
->getStorage('taxonomy_vocabulary')
->loadMultiple();
$menus = [];
foreach ($all_taxonomies as $id => $menu) {
$menus[$id] = $menu
->label();
}
asort($menus);
return $menus;
}