You are here

RouteSubscriber.php in Module Builder 8.3

File

module_builder_devel/src/Routing/RouteSubscriber.php
View source
<?php

namespace Drupal\module_builder_devel\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Alters the code analysis route to use our form class.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  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);
    }
  }

}

Classes

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