Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MaintenanceMode.php

function MaintenanceMode::applies

Overrides MaintenanceModeInterface::applies

File

core/lib/Drupal/Core/Site/MaintenanceMode.php, line 46

Class

MaintenanceMode
Provides the default implementation of the maintenance mode service.

Namespace

Drupal\Core\Site

Code

public function applies(RouteMatchInterface $route_match) {
    if (!$this->state
        ->get('system.maintenance_mode')) {
        return FALSE;
    }
    if ($route = $route_match->getRouteObject()) {
        if ($route->getOption('_maintenance_access')) {
            return FALSE;
        }
    }
    return TRUE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal