You are here

public function PathSubscriber::onKernelController in Drupal 8

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()), '/'));
  }
}