function ThemeAccessCheck::access

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Theme/ThemeAccessCheck.php \Drupal\Core\Theme\ThemeAccessCheck::access()
  2. 8.9.x core/lib/Drupal/Core/Theme/ThemeAccessCheck.php \Drupal\Core\Theme\ThemeAccessCheck::access()
  3. 10 core/lib/Drupal/Core/Theme/ThemeAccessCheck.php \Drupal\Core\Theme\ThemeAccessCheck::access()

Checks access to the theme for routing.

Parameters

string $theme: The name of a theme.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

File

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

Class

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

Namespace

Drupal\Core\Theme

Code

public function access($theme) {
    // Cacheable until the theme settings are modified.
    return AccessResult::allowedIf($this->checkAccess($theme))
        ->addCacheTags([
        'config:' . $theme . '.settings',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.