function BatchNegotiator::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/ src/ Theme/ BatchNegotiator.php, line 52  
Class
- BatchNegotiator
 - Sets the active theme for the batch page.
 
Namespace
Drupal\system\ThemeCode
public function determineActiveTheme(RouteMatchInterface $route_match) {
  // Retrieve the current state of the batch.
  $request = $this->requestStack
    ->getCurrentRequest();
  $batch =& batch_get();
  if (!$batch && $request->request
    ->has('id')) {
    $batch = $this->batchStorage
      ->load($request->request
      ->get('id'));
  }
  // Use the same theme as the page that started the batch.
  if (!empty($batch['theme'])) {
    return $batch['theme'];
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.