You are here

private function ThemeNegotiator::negotiateRoute in Gin Login 8

Function that does all of the work in selecting a theme.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match:

Return value

bool|string

2 calls to ThemeNegotiator::negotiateRoute()
ThemeNegotiator::applies in src/Theme/ThemeNegotiator.php
ThemeNegotiator::determineActiveTheme in src/Theme/ThemeNegotiator.php

File

src/Theme/ThemeNegotiator.php, line 47

Class

ThemeNegotiator
Contains \Drupal\gin_login\Theme\ThemeNegotiator Credit to jimconte https://jimconte.com/blog/web/dynamic-theme-switching-in-drupal-8.

Namespace

Drupal\gin_login\Theme

Code

private function negotiateRoute(RouteMatchInterface $route_match) {
  if ($route_match
    ->getRouteName() == 'user.login' || $route_match
    ->getRouteName() == 'user.pass' || $route_match
    ->getRouteName() == 'user.register') {
    return $this->configFactory
      ->get('system.theme')
      ->get('admin');
  }
  return FALSE;
}