Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GenerateTheme.php

function 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
Executes the current command.

File

core/lib/Drupal/Core/Command/GenerateTheme.php, line 223

Class

GenerateTheme
Generates a new theme based on latest default markup.

Namespace

Drupal\Core\Command

Code

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;
}
RSS feed
Powered by Drupal