You are here

public function AmpNegotiator::applies in Accelerated Mobile Pages (AMP) 8.3

Same name and namespace in other branches
  1. 8 src/Theme/AmpNegotiator.php \Drupal\amp\Theme\AmpNegotiator::applies()
  2. 8.2 src/Theme/AmpNegotiator.php \Drupal\amp\Theme\AmpNegotiator::applies()

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

src/Theme/AmpNegotiator.php, line 46

Class

AmpNegotiator
Sets the active theme on amp pages.

Namespace

Drupal\amp\Theme

Code

public function applies(RouteMatchInterface $routeMatch) {

  // See if this route and object are AMP, without checking the active theme.
  return $this->ampContext
    ->isAmpRoute($routeMatch, NULL, FALSE);
}