You are here

private function RenameAdminPathsEventSubscriber::matchRouteByPath in Rename Admin Paths 8.2

Parameters

Route $route:

string $path:

Return value

boolean

match /path, /path/ and /path/* but not /path*

1 call to RenameAdminPathsEventSubscriber::matchRouteByPath()
RenameAdminPathsEventSubscriber::replaceRoutePath in src/EventSubscriber/RenameAdminPathsEventSubscriber.php

File

src/EventSubscriber/RenameAdminPathsEventSubscriber.php, line 108

Class

RenameAdminPathsEventSubscriber

Namespace

Drupal\rename_admin_paths\EventSubscriber

Code

private function matchRouteByPath(Route $route, string $path) : bool {
  return (bool) preg_match(sprintf('~^/%s(?:/(.*))?$~', $path), $route
    ->getPath());
}