CustomThemeNegotiator.php in Zircon Profile 8.0
File
core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php
View source
<?php
namespace Drupal\theme_test\Theme;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeNegotiatorInterface;
class CustomThemeNegotiator implements ThemeNegotiatorInterface {
public function applies(RouteMatchInterface $route_match) {
$route = $route_match
->getRouteObject();
return $route && $route
->hasOption('_custom_theme');
}
public function determineActiveTheme(RouteMatchInterface $route_match) {
return $route_match
->getRouteObject()
->getOption('_custom_theme');
}
}