function PathSubscriber::onKernelController

Sets the cache key on the alias manager cache decorator.

KernelEvents::CONTROLLER is used in order to be executed after routing.

Parameters

\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event: The Event to process.

File

core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php, line 64

Class

PathSubscriber
Provides a path subscriber that converts path aliases.

Namespace

Drupal\Core\EventSubscriber

Code

public function onKernelController(FilterControllerEvent $event) {
  // Set the cache key on the alias manager cache decorator.
  if ($event->isMasterRequest()) {
    $this->aliasManager
      ->setCacheKey(rtrim($this->currentPath
      ->getPath($event->getRequest()), '/'));
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.