You are here

class RouteSubscriber in Menu Item Extras 8.2

Class RouteSubscriber.

@package Drupal\menu_item_extras\Routing

Hierarchy

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

Expanded class hierarchy of RouteSubscriber

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

File

src/Routing/RouteSubscriber.php, line 14

Namespace

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

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    $route = $collection
      ->get('entity.menu.add_link_form');
    if ($route) {
      $route
        ->setDefault('_controller', MenuController::class . '::addLink');
    }
  }

}

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