You are here

class AutocompleteRouteSubscriber in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x modules/opigno_alter_entity_autocomplete/src/Routing/AutocompleteRouteSubscriber.php \Drupal\opigno_alter_entity_autocomplete\Routing\AutocompleteRouteSubscriber

Class AutocompleteRouteSubscriber.

Hierarchy

Expanded class hierarchy of AutocompleteRouteSubscriber

1 string reference to 'AutocompleteRouteSubscriber'
opigno_alter_entity_autocomplete.services.yml in modules/opigno_alter_entity_autocomplete/opigno_alter_entity_autocomplete.services.yml
modules/opigno_alter_entity_autocomplete/opigno_alter_entity_autocomplete.services.yml
1 service uses AutocompleteRouteSubscriber
opigno_alter_entity_autocomplete.route_subscriber in modules/opigno_alter_entity_autocomplete/opigno_alter_entity_autocomplete.services.yml
Drupal\opigno_alter_entity_autocomplete\Routing\AutocompleteRouteSubscriber

File

modules/opigno_alter_entity_autocomplete/src/Routing/AutocompleteRouteSubscriber.php, line 11

Namespace

Drupal\opigno_alter_entity_autocomplete\Routing
View source
class AutocompleteRouteSubscriber extends RouteSubscriberBase {

  /**
   * Alters route.
   *
   * @param \Symfony\Component\Routing\RouteCollection $collection
   *   Routes.
   */
  public function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('system.entity_autocomplete')) {
      $route
        ->setDefault('_controller', '\\Drupal\\opigno_alter_entity_autocomplete\\Controller\\EntityAutocompleteController::handleAutocomplete');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AutocompleteRouteSubscriber::alterRoutes public function Alters route. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1