function CustomThemeNegotiator::applies

Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php \Drupal\theme_test\Theme\CustomThemeNegotiator::applies()
  2. 10 core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php \Drupal\theme_test\Theme\CustomThemeNegotiator::applies()
  3. 11.x core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php \Drupal\theme_test\Theme\CustomThemeNegotiator::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

core/modules/system/tests/modules/theme_test/src/Theme/CustomThemeNegotiator.php, line 16

Class

CustomThemeNegotiator
Just forces the 'test_theme' theme.

Namespace

Drupal\theme_test\Theme

Code

public function applies(RouteMatchInterface $route_match) {
    $route = $route_match->getRouteObject();
    return $route && $route->hasOption('_custom_theme');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.