You are here

public function WebformThemeManager::getThemeNames in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformThemeManager.php \Drupal\webform\WebformThemeManager::getThemeNames()

Get themes as associative array.

Return value

array An associative array containing theme name.

Overrides WebformThemeManagerInterface::getThemeNames

File

src/WebformThemeManager.php, line 112

Class

WebformThemeManager
Defines a class to manage webform theming.

Namespace

Drupal\webform

Code

public function getThemeNames() {
  $themes = [];
  foreach ($this->themeHandler
    ->listInfo() as $name => $theme) {
    if ($theme->status === 1) {
      $themes[$name] = $theme->info['name'];
    }
  }
  asort($themes);
  return [
    '' => $this
      ->t('Default'),
  ] + $themes;
}