You are here

protected function Redirect::isExcludedRoute in Entity Legal 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/EntityLegal/Redirect.php \Drupal\entity_legal\Plugin\EntityLegal\Redirect::isExcludedRoute()
  2. 4.0.x src/Plugin/EntityLegal/Redirect.php \Drupal\entity_legal\Plugin\EntityLegal\Redirect::isExcludedRoute()

Checks if the current route is excluded.

Parameters

string $route_name: The route name.

\Drupal\entity_legal\EntityLegalDocumentInterface $document: The legal document entity.

Return value

bool If the current route is excluded.

1 call to Redirect::isExcludedRoute()
Redirect::execute in src/Plugin/EntityLegal/Redirect.php
Execute callback for Entity Legal method plugin.

File

src/Plugin/EntityLegal/Redirect.php, line 158

Class

Redirect
Method class for redirecting existing users to accept a legal document.

Namespace

Drupal\entity_legal\Plugin\EntityLegal

Code

protected function isExcludedRoute($route_name, EntityLegalDocumentInterface $document) {
  $excluded_routes = [
    'system.csrftoken',
    'user.logout',
    $document
      ->toUrl()
      ->getRouteName(),
  ];
  return in_array($route_name, $excluded_routes);
}