function GenerateTheme::getThemeInfo
Same name in other branches
- 9 core/lib/Drupal/Core/Command/GenerateTheme.php \Drupal\Core\Command\GenerateTheme::getThemeInfo()
- 10 core/lib/Drupal/Core/Command/GenerateTheme.php \Drupal\Core\Command\GenerateTheme::getThemeInfo()
Gets theme info using the theme name.
Parameters
string $theme_name: The machine name of the theme.
Return value
\Drupal\Core\Extension\Extension|null
1 call to GenerateTheme::getThemeInfo()
- GenerateTheme::execute in core/
lib/ Drupal/ Core/ Command/ GenerateTheme.php
File
-
core/
lib/ Drupal/ Core/ Command/ GenerateTheme.php, line 223
Class
- GenerateTheme
- Generates a new theme based on latest default markup.
Namespace
Drupal\Core\CommandCode
private function getThemeInfo(string $theme_name) : ?Extension {
$extension_discovery = new ExtensionDiscovery($this->root, FALSE, []);
$themes = $extension_discovery->scan('theme');
$theme = $themes[$theme_name] ?? NULL;
if ($theme !== NULL) {
$theme->info = (new InfoParser($this->root))
->parse($theme->getPathname());
}
return $theme;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.