ThemeAccessCheck::checkAccess

public ThemeAccessCheck::checkAccess($theme)

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.

File

core/lib/Drupal/Core/Theme/ThemeAccessCheck.php, line 53

Class

ThemeAccessCheck
Provides access checking for themes for routing and theme negotiation.

Namespace

Drupal\Core\Theme

Code

public function checkAccess($theme) {
  $themes = $this->themeHandler->listInfo();
  return !empty($themes[$theme]->status);
}
doc_Drupal
2016-10-29 09:47:52
Comments
Leave a Comment

Please login to continue.