function LayoutPluginManager::getCategories
Gets the names of all categories.
Return value
string[] An array of translated categories, sorted alphabetically.
Overrides CategorizingPluginManagerInterface::getCategories
File
- 
              core/lib/ Drupal/ Core/ Layout/ LayoutPluginManager.php, line 185 
Class
- LayoutPluginManager
- Provides a plugin manager for layouts.
Namespace
Drupal\Core\LayoutCode
public function getCategories() {
  // Fetch all categories from definitions and remove duplicates.
  $categories = array_unique(array_values(array_map(function (LayoutDefinition $definition) {
    return $definition->getCategory();
  }, $this->getDefinitions())));
  natcasesort($categories);
  return $categories;
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
