You are here

public function RenameAdminPathsEventSubscriber::onRoutesAlter in Rename Admin Paths 8.2

Parameters

RouteBuildEvent $event:

File

src/EventSubscriber/RenameAdminPathsEventSubscriber.php, line 51

Class

RenameAdminPathsEventSubscriber

Namespace

Drupal\rename_admin_paths\EventSubscriber

Code

public function onRoutesAlter(RouteBuildEvent $event) {
  foreach (self::ADMIN_PATHS as $path) {
    if ($this->config
      ->isPathEnabled($path)) {
      $this
        ->alterRouteCollection($event
        ->getRouteCollection(), $path, $this->config
        ->getPathValue($path));
    }
  }
}