You are here

AutocompleteRouteSubscriber.php in Panopoly Widgets 8.2

File

src/Routing/AutocompleteRouteSubscriber.php
View source
<?php

namespace Drupal\panopoly_widgets\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Rout subscriber to setup our entity autocomplete controller.
 */
class AutocompleteRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('system.entity_autocomplete')) {
      $route
        ->setDefault('_controller', '\\Drupal\\panopoly_widgets\\Controller\\EntityAutocompleteController::handleAutocomplete');
    }
  }

}

Classes

Namesort descending Description
AutocompleteRouteSubscriber Rout subscriber to setup our entity autocomplete controller.