You are here

public function ThemeInfo::themeNameExists in AT Tools 8.2

Same name and namespace in other branches
  1. 8.3 at_theme_generator/src/Theme/ThemeInfo.php \Drupal\at_theme_generator\Theme\ThemeInfo::themeNameExists()
  2. 8 at_theme_generator/src/Theme/ThemeInfo.php \Drupal\at_theme_generator\Theme\ThemeInfo::themeNameExists()

Check if a theme name already exists. Looks in the list of themes to see if a theme name already exists, if so returns TRUE. This is the callback method for the form field machine_name as used in theme-settings.php for the theme Generator.

Parameters

$machine_name:

Return value

boolean

File

at_theme_generator/src/Theme/ThemeInfo.php, line 68
Contains \Drupal\at_theme_generator\Theme\ThemeInfo.

Class

ThemeInfo
ThemeSettingsInfo declares methods used to return theme info for use in theme-settings.php. Note the constructor calls system_rebuild_theme_data() which is not statically cached therefor only used in the backend, however it always returns fresh data.

Namespace

Drupal\at_theme_generator\Theme

Code

public function themeNameExists($machine_name) {
  $result = FALSE;
  if (array_key_exists($machine_name, $this->data)) {
    $result = TRUE;
  }
  return $result;
}