You are here

RealnameRouteSubscriber.php in Real Name 8

Same filename and directory in other branches
  1. 2.x src/Routing/RealnameRouteSubscriber.php

File

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

namespace Drupal\realname\Routing;

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

/**
 * Subscriber for routes.
 */
class RealnameRouteSubscriber extends RouteSubscriberBase {

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

}

Classes

Namesort descending Description
RealnameRouteSubscriber Subscriber for routes.