AjaxBasePageNegotiator::applies

public AjaxBasePageNegotiator::applies(RouteMatchInterface $route_match)

Whether this theme negotiator should be used to set the theme.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match object.

Return value

bool TRUE if this negotiator should be used or FALSE to let other negotiators decide.

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']);
}
doc_Drupal
2016-10-29 08:44:01
Comments
Leave a Comment

Please login to continue.