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

Breadcrumb

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

function ThemeController::willInstallExperimentalTheme

Checks if the given theme requires the installation of experimental themes.

Parameters

string $theme: The name of the theme to check.

Return value

bool Whether experimental themes will be installed.

2 calls to ThemeController::willInstallExperimentalTheme()
ThemeController::install in core/modules/system/src/Controller/ThemeController.php
Installs a theme.
ThemeController::setDefaultTheme in core/modules/system/src/Controller/ThemeController.php
Set the default theme.

File

core/modules/system/src/Controller/ThemeController.php, line 171

Class

ThemeController
Controller for theme handling.

Namespace

Drupal\system\Controller

Code

protected function willInstallExperimentalTheme($theme) {
    $all_themes = $this->themeList
        ->getList();
    $dependencies = array_keys($all_themes[$theme]->requires);
    $themes_to_enable = array_merge([
        $theme,
    ], $dependencies);
    foreach ($themes_to_enable as $name) {
        if (isset($all_themes[$name]) && $all_themes[$name]->isExperimental() && $all_themes[$name]->status === 0) {
            return TRUE;
        }
    }
    return FALSE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal