function ThemeController::willInstallExperimentalTheme
Same name in other branches
- 9 core/modules/system/src/Controller/ThemeController.php \Drupal\system\Controller\ThemeController::willInstallExperimentalTheme()
- 10 core/modules/system/src/Controller/ThemeController.php \Drupal\system\Controller\ThemeController::willInstallExperimentalTheme()
- 11.x core/modules/system/src/Controller/ThemeController.php \Drupal\system\Controller\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 184
Class
- ThemeController
- Controller for theme handling.
Namespace
Drupal\system\ControllerCode
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 (!empty($all_themes[$name]->info['experimental']) && $all_themes[$name]->status === 0) {
return TRUE;
}
}
return FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.