You are here

public function SchedulerThemeNegotiator::applies in Scheduler 2.x

Same name and namespace in other branches
  1. 8 src/Theme/SchedulerThemeNegotiator.php \Drupal\scheduler\Theme\SchedulerThemeNegotiator::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

src/Theme/SchedulerThemeNegotiator.php, line 16

Class

SchedulerThemeNegotiator
Defines a theme negotiator for the Scheduler routes.

Namespace

Drupal\scheduler\Theme

Code

public function applies(RouteMatchInterface $route_match) {

  // Use the Scheduler theme negotiator for scheduler views on the user page.
  $user_page_routes = \Drupal::service('scheduler.manager')
    ->getUserPageViewRoutes();
  $applies = in_array($route_match
    ->getRouteName(), $user_page_routes);
  return $applies;
}