function AjaxBasePageNegotiator::applies

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php \Drupal\Core\Theme\AjaxBasePageNegotiator::applies()
  2. 10 core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php \Drupal\Core\Theme\AjaxBasePageNegotiator::applies()
  3. 11.x core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php \Drupal\Core\Theme\AjaxBasePageNegotiator::applies()

Overrides ThemeNegotiatorInterface::applies

File

core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php, line 67

Class

AjaxBasePageNegotiator
Defines a theme negotiator that deals with the active theme on ajax requests.

Namespace

Drupal\Core\Theme

Code

public function applies(RouteMatchInterface $route_match) {
    $ajax_page_state = $this->requestStack
        ->getCurrentRequest()->request
        ->get('ajax_page_state');
    return !empty($ajax_page_state['theme']) && isset($ajax_page_state['theme_token']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.