You are here

public function renderCheeseburgerMenuBlock::getAllTaxonomyTermNames in Cheeseburger Menu 8

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

Return value

all taxonomy term translated names

File

src/Controller/renderCheeseburgerMenuBlock.php, line 463

Class

renderCheeseburgerMenuBlock

Namespace

Drupal\cheeseburger_menu\Controller

Code

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