You are here

protected function RouteSubscriber::alterRoutes in Layout Builder Browser 8

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

src/Routing/RouteSubscriber.php, line 17

Class

RouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\layout_builder_browser\Routing

Code

protected function alterRoutes(RouteCollection $collection) {

  // Override the layout builder choose block controller with ours.
  if ($route = $collection
    ->get('layout_builder.choose_block')) {
    $route
      ->setDefault('_controller', '\\Drupal\\layout_builder_browser\\Controller\\BrowserController::browse');
  }
}