social_event_invite_flow-1.0.0-beta3/src/Theme/ThemeNegotiator.php
src/Theme/ThemeNegotiator.php
<?php
namespace Drupal\social_event_invite_flow\Theme;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\Routing\Route;
use Drupal\Core\Theme\ThemeNegotiatorInterface;
/**
* Our Gianduja Theme Negotiator
*/
class ThemeNegotiator implements ThemeNegotiatorInterface {
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
$route = $route_match->getRouteObject();
if (!$route instanceof Route) {
return FALSE;
}
$option = $route->getOption('_custom_theme');
if (!$option) {
return FALSE;
}
return $option == 'stark';
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
return 'stark';
}
}
