You are here

public function RenderCheeseburgerMenuBlock::getAllTaxonomyTermNames in Cheeseburger Menu 8.2

Same name and namespace in other branches
  1. 8.4 src/Controller/RenderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\RenderCheeseburgerMenuBlock::getAllTaxonomyTermNames()
  2. 8 src/Controller/renderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\renderCheeseburgerMenuBlock::getAllTaxonomyTermNames()
  3. 8.3 src/Controller/RenderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\RenderCheeseburgerMenuBlock::getAllTaxonomyTermNames()

Get all taxonomy term names.

File

src/Controller/RenderCheeseburgerMenuBlock.php, line 643
Controller used for rendering block.

Class

RenderCheeseburgerMenuBlock
Class RenderCheeseburgerMenuBlock.

Namespace

Drupal\cheeseburger_menu\Controller

Code

public function getAllTaxonomyTermNames() {
  $all_taxonomies = $this
    ->entityTypeManager()
    ->getStorage('taxonomy_vocabulary')
    ->loadMultiple();
  $menus = [];
  foreach ($all_taxonomies as $id => $menu) {
    $menus[$id] = $menu
      ->label();
  }
  asort($menus);
  return $menus;
}