You are here

public function CustomThemeNegotiator::determineActiveTheme in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php \Drupal\theme_test\Theme\CustomThemeNegotiator::determineActiveTheme()
  2. 9 core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php \Drupal\theme_test\Theme\CustomThemeNegotiator::determineActiveTheme()

Determine the active theme for the request.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match object.

Return value

string|null The name of the theme, or NULL if other negotiators, like the configured default one, should be used instead.

Overrides ThemeNegotiatorInterface::determineActiveTheme

File

core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php, line 24

Class

CustomThemeNegotiator
Just forces the 'test_theme' theme.

Namespace

Drupal\theme_test\Theme

Code

public function determineActiveTheme(RouteMatchInterface $route_match) {
  return $route_match
    ->getRouteObject()
    ->getOption('_custom_theme');
}