You are here

class AdminDemoNegotiator in Drupal 9

Same name and namespace in other branches
  1. 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

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\Theme
View 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

Namesort descending Modifiers Type Description Overrides
AdminDemoNegotiator::applies public function Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface::applies
AdminDemoNegotiator::determineActiveTheme public function Determine the active theme for the request. Overrides ThemeNegotiatorInterface::determineActiveTheme