class PathAliasSubscriber extends PathSubscriber (View source)

Provides a path subscriber that converts path aliases.

Properties

protected AliasManagerInterface $aliasManager

The alias manager that caches alias lookups based on the request.

from  PathSubscriber
protected CurrentPathStack $currentPath

The current path.

from  PathSubscriber

Methods

__construct(AliasManagerInterface $alias_manager, CurrentPathStack $current_path)

Constructs a new PathSubscriber instance.

onKernelController(FilterControllerEvent $event)

Sets the cache key on the alias manager cache decorator.

onKernelTerminate(PostResponseEvent $event)

Ensures system paths for the request get cached.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

__construct(AliasManagerInterface $alias_manager, CurrentPathStack $current_path)

Constructs a new PathSubscriber instance.

Parameters

AliasManagerInterface $alias_manager

The alias manager.

CurrentPathStack $current_path

The current path.

onKernelController(FilterControllerEvent $event)

Sets the cache key on the alias manager cache decorator.

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

Parameters

FilterControllerEvent $event

The Event to process.

onKernelTerminate(PostResponseEvent $event)

Ensures system paths for the request get cached.

Parameters

PostResponseEvent $event

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.