You are here

protected function GatsbyInstantPreviewRouteSubscriber::alterRoutes in Gatsby Live Preview & Incremental Builds 8

Same name and namespace in other branches
  1. 2.0.x modules/gatsby_instantpreview/src/Routing/GatsbyInstantPreviewRouteSubscriber.php \Drupal\gatsby_instantpreview\Routing\GatsbyInstantPreviewRouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

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

Overrides RouteSubscriberBase::alterRoutes

File

modules/gatsby_instantpreview/src/Routing/GatsbyInstantPreviewRouteSubscriber.php, line 16

Class

GatsbyInstantPreviewRouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\gatsby_instantpreview\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('gatsby.gatsby_admin_form')) {
    $route
      ->setDefault('_form', 'Drupal\\gatsby_instantpreview\\Form\\GatsbyInstantPreviewAdminForm');
  }
}