You are here

GatsbyInstantPreviewRouteSubscriber.php in Gatsby Live Preview & Incremental Builds 8

File

modules/gatsby_instantpreview/src/Routing/GatsbyInstantPreviewRouteSubscriber.php
View source
<?php

namespace Drupal\gatsby_instantpreview\Routing;

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

/**
 * Listens to the dynamic route events.
 */
class GatsbyInstantPreviewRouteSubscriber extends RouteSubscriberBase {

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

}

Classes

Namesort descending Description
GatsbyInstantPreviewRouteSubscriber Listens to the dynamic route events.