You are here

class RouteSubscriber in Module Builder 8.3

Alters the code analysis route to use our form class.

Hierarchy

  • class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
module_builder_devel.services.yml in module_builder_devel/module_builder_devel.services.yml
module_builder_devel/module_builder_devel.services.yml
1 service uses RouteSubscriber
module_builder_devel.route_subscriber in module_builder_devel/module_builder_devel.services.yml
Drupal\module_builder_devel\Routing\RouteSubscriber

File

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

Namespace

Drupal\module_builder_devel\Routing
View source
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);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1