public function AmpContext::routeThemeisAmp in Accelerated Mobile Pages (AMP) 8.3
Same name and namespace in other branches
- 8.2 src/Routing/AmpContext.php \Drupal\amp\Routing\AmpContext::routeThemeisAmp()
See if this route uses the AMP theme.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.
Return value
boolean
1 call to AmpContext::routeThemeisAmp()
- AmpContext::isAmpRoute in src/
Routing/ AmpContext.php - Determines whether the active route is an AMP route.
File
- src/
Routing/ AmpContext.php, line 125
Class
- AmpContext
- Provides a helper class to determine whether the route is an amp one.
Namespace
Drupal\amp\RoutingCode
public function routeThemeisAmp(RouteMatchInterface $routeMatch) {
$current_theme = $this->themeManager
->getActiveTheme($routeMatch)
->getName();
$amp_theme = $this->configFactory
->get('amp.theme')
->get('amptheme');
if ($amp_theme == $current_theme) {
return TRUE;
}
return FALSE;
}