RouteSubscriber.php

Namespace

Drupal\media_test_embed\Routing

File

core/modules/media/tests/modules/media_test_embed/src/Routing/RouteSubscriber.php

View source
<?php

namespace Drupal\media_test_embed\Routing;

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

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {
  
  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    if ($route = $collection->get('media.filter.preview')) {
      $route->setDefault('_controller', '\\Drupal\\media_test_embed\\Controller\\TestMediaFilterController::preview');
    }
  }

}

Classes

Title Deprecated Summary
RouteSubscriber Listens to the dynamic route events.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.