You are here

protected function RouteSubscriber::alterRoutes in Password Separate Form 8

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

src/Routing/RouteSubscriber.php, line 16

Class

RouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\change_pwd_page\Routing

Code

protected function alterRoutes(RouteCollection $collection) {

  // As Change Password page is separate form now so in order to do that,
  // override user.reset route with change_pwd_page.reset route to show the
  // Change Password form instead of default.
  if ($route = $collection
    ->get('user.reset')) {
    $route
      ->setPath('/user/reset/{uid}/{timestamp}/{hash}/new');
  }
}