RouteSubscriber.php in Menu Item Extras 8.2
Namespace
Drupal\menu_item_extras\RoutingFile
src/Routing/RouteSubscriber.phpView source
<?php
namespace Drupal\menu_item_extras\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\menu_item_extras\Controller\MenuController;
use Symfony\Component\Routing\RouteCollection;
/**
* Class RouteSubscriber.
*
* @package Drupal\menu_item_extras\Routing
*/
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');
}
}
}
Classes
Name | Description |
---|---|
RouteSubscriber | Class RouteSubscriber. |