class AutocompleteRouteSubscriber in Panopoly 8.2
Rout subscriber to setup our entity autocomplete controller.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\panopoly_widgets\Routing\AutocompleteRouteSubscriber
Expanded class hierarchy of AutocompleteRouteSubscriber
1 string reference to 'AutocompleteRouteSubscriber'
- panopoly_widgets.services.yml in modules/
panopoly/ panopoly_widgets/ panopoly_widgets.services.yml - modules/panopoly/panopoly_widgets/panopoly_widgets.services.yml
1 service uses AutocompleteRouteSubscriber
- panopoly_widgets.route_subscriber in modules/
panopoly/ panopoly_widgets/ panopoly_widgets.services.yml - Drupal\panopoly_widgets\Routing\AutocompleteRouteSubscriber
File
- modules/
panopoly/ panopoly_widgets/ src/ Routing/ AutocompleteRouteSubscriber.php, line 11
Namespace
Drupal\panopoly_widgets\RoutingView source
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');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AutocompleteRouteSubscriber:: |
public | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |