class CustomThemeNegotiator in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php \Drupal\theme_test\Theme\CustomThemeNegotiator
Just forces the 'test_theme' theme.
Hierarchy
- class \Drupal\theme_test\Theme\CustomThemeNegotiator implements ThemeNegotiatorInterface
Expanded class hierarchy of CustomThemeNegotiator
1 string reference to 'CustomThemeNegotiator'
- theme_test.services.yml in core/
modules/ system/ tests/ modules/ theme_test/ theme_test.services.yml - core/modules/system/tests/modules/theme_test/theme_test.services.yml
1 service uses CustomThemeNegotiator
- theme.negotiator.test_custom_theme in core/
modules/ system/ tests/ modules/ theme_test/ theme_test.services.yml - Drupal\theme_test\Theme\CustomThemeNegotiator
File
- core/
modules/ system/ tests/ modules/ theme_test/ src/ Theme/ CustomThemeNegotiator.php, line 16 - Contains \Drupal\theme_test\Theme\CustomThemeNegotiator.
Namespace
Drupal\theme_test\ThemeView source
class CustomThemeNegotiator implements ThemeNegotiatorInterface {
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
$route = $route_match
->getRouteObject();
return $route && $route
->hasOption('_custom_theme');
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
return $route_match
->getRouteObject()
->getOption('_custom_theme');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CustomThemeNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface:: |
|
CustomThemeNegotiator:: |
public | function |
Determine the active theme for the request. Overrides ThemeNegotiatorInterface:: |