You are here

class RouteSubscriber in Panopoly 8.2

Same name in this branch
  1. 8.2 modules/panopoly/panopoly_magic/src/Routing/RouteSubscriber.php \Drupal\panopoly_magic\Routing\RouteSubscriber
  2. 8.2 modules/panopoly/panopoly_media/src/Routing/RouteSubscriber.php \Drupal\panopoly_media\Routing\RouteSubscriber

Implements a route subscriber for Panopoly Media.

Hierarchy

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

Expanded class hierarchy of RouteSubscriber

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

File

modules/panopoly/panopoly_media/src/Routing/RouteSubscriber.php, line 11

Namespace

Drupal\panopoly_media\Routing
View source
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {

    // Remove the title from our entity browsers.
    $entity_browser_ids = [
      'panopoly_media_field_media_browser',
      'panopoly_media_wysiwyg_media_browser',
    ];
    foreach ($entity_browser_ids as $entity_browser_id) {
      if ($route = $collection
        ->get("entity_browser.{$entity_browser_id}")) {
        $defaults = $route
          ->getDefaults();
        unset($defaults['_title_callback']);
        $route
          ->setDefaults($defaults);
      }
    }
  }

}

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