You are here

public function ThrobberManager::RouteIsApplicable in Ajax loader 8

Function to check if Route is Applicable.

inheritdoc} @codingStandardsIgnoreStart

Overrides ThrobberManagerInterface::RouteIsApplicable

File

src/ThrobberManager.php, line 74

Class

ThrobberManager
Gathers the throbber plugins.

Namespace

Drupal\ajax_loader

Code

public function RouteIsApplicable() {

  // @codingStandardsIgnoreEnd
  $is_applicable = FALSE;
  $settings = $this->configFactory
    ->get('ajax_loader.settings');
  $is_admin_route = $this->adminContext
    ->isAdminRoute();
  $current_route_name = $this->request->attributes
    ->get('_route');
  if (!$is_admin_route) {

    // Always applicable.
    $is_applicable = TRUE;
  }
  elseif ($settings
    ->get('show_admin_paths') && $current_route_name != 'ajax_loader.settings') {
    $is_applicable = TRUE;
  }
  return $is_applicable;
}