class AdminDemoNegotiator in Drupal 9
Same name and namespace in other branches
- 8 core/modules/block/src/Theme/AdminDemoNegotiator.php \Drupal\block\Theme\AdminDemoNegotiator
Negotiates the theme for the block admin demo page via the URL.
Hierarchy
- class \Drupal\block\Theme\AdminDemoNegotiator implements ThemeNegotiatorInterface
Expanded class hierarchy of AdminDemoNegotiator
1 string reference to 'AdminDemoNegotiator'
- block.services.yml in core/
modules/ block/ block.services.yml - core/modules/block/block.services.yml
1 service uses AdminDemoNegotiator
- theme.negotiator.block.admin_demo in core/
modules/ block/ block.services.yml - Drupal\block\Theme\AdminDemoNegotiator
File
- core/
modules/ block/ src/ Theme/ AdminDemoNegotiator.php, line 11
Namespace
Drupal\block\ThemeView source
class AdminDemoNegotiator implements ThemeNegotiatorInterface {
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
return $route_match
->getRouteName() == 'block.admin_demo';
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
// We return exactly what was passed in, to guarantee that the page will
// always be displayed using the theme whose blocks are being configured.
return $route_match
->getParameter('theme');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdminDemoNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface:: |
|
AdminDemoNegotiator:: |
public | function |
Determine the active theme for the request. Overrides ThemeNegotiatorInterface:: |