You are here

public function RouteAlterSubscriber::onRouteAlter in Views Ajax Get 2.0.x

Same name and namespace in other branches
  1. 8 src/EventSubscriber/RouteAlterSubscriber.php \Drupal\views_ajax_get\EventSubscriber\RouteAlterSubscriber::onRouteAlter()

File

src/EventSubscriber/RouteAlterSubscriber.php, line 11

Class

RouteAlterSubscriber

Namespace

Drupal\views_ajax_get\EventSubscriber

Code

public function onRouteAlter(RouteBuildEvent $event) {
  $collection = $event
    ->getRouteCollection();
  if ($route = $collection
    ->get('views.ajax')) {
    $route
      ->setDefault('_controller', '\\Drupal\\views_ajax_get\\Controller\\ViewsAjaxController::ajaxView');
  }
}