public function ThemeAccessCheck::checkAccess in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Theme/ThemeAccessCheck.php \Drupal\Core\Theme\ThemeAccessCheck::checkAccess()
- 9 core/lib/Drupal/Core/Theme/ThemeAccessCheck.php \Drupal\Core\Theme\ThemeAccessCheck::checkAccess()
Indicates whether the theme is accessible based on whether it is installed.
Parameters
string $theme: The name of a theme.
Return value
bool TRUE if the theme is installed, FALSE otherwise.
1 call to ThemeAccessCheck::checkAccess()
- ThemeAccessCheck::access in core/
lib/ Drupal/ Core/ Theme/ ThemeAccessCheck.php - Checks access to the theme for routing.
File
- core/
lib/ Drupal/ Core/ Theme/ ThemeAccessCheck.php, line 54
Class
- ThemeAccessCheck
- Provides access checking for themes for routing and theme negotiation.
Namespace
Drupal\Core\ThemeCode
public function checkAccess($theme) {
$themes = $this->themeHandler
->listInfo();
return !empty($themes[$theme]->status);
}