You are here

public function HeartbeatAutocompleteSubscriber::alterRoutes in Heartbeat 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/HeartbeatAutocompleteSubscriber.php, line 9

Class

HeartbeatAutocompleteSubscriber

Namespace

Drupal\heartbeat\Routing

Code

public function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('system.entity_autocomplete')) {
    $route
      ->setDefault('_controller', '\\Drupal\\heartbeat\\Controller\\HeartbeatAutocompleteController::handleAutocomplete');
  }
}