private function RenameAdminPathsEventSubscriber::replaceRoutePath in Rename Admin Paths 8.2
Parameters
Route $route:
string $from:
string $to:
1 call to RenameAdminPathsEventSubscriber::replaceRoutePath()
- RenameAdminPathsEventSubscriber::alterRouteCollection in src/
EventSubscriber/ RenameAdminPathsEventSubscriber.php
File
- src/
EventSubscriber/ RenameAdminPathsEventSubscriber.php, line 83
Class
Namespace
Drupal\rename_admin_paths\EventSubscriberCode
private function replaceRoutePath(Route $route, string $from, string $to) : void {
if ($this
->matchRouteByPath($route, $from)) {
$route
->setPath(preg_replace(sprintf('~^/%s~', $from), sprintf('/%s', $to), $route
->getPath(), 1));
}
}