You are here

protected function RouteSubscriber::alterRoutes in Module Builder 8.3

Alters existing routes for a specific collection.

Parameters

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

Overrides RouteSubscriberBase::alterRoutes

File

module_builder_devel/src/Routing/RouteSubscriber.php, line 16

Class

RouteSubscriber
Alters the code analysis route to use our form class.

Namespace

Drupal\module_builder_devel\Routing

Code

protected function alterRoutes(RouteCollection $collection) {

  // Change form class for the process form.
  if ($route = $collection
    ->get('module_builder.analyse')) {
    $route
      ->setDefault('_form', \Drupal\module_builder_devel\Form\ProcessFormExtra::class);
  }
}