class RedirectResponseSubscriber implements EventSubscriberInterface (View source)

Allows manipulation of the response object when performing a redirect.

Properties

protected UnroutedUrlAssemblerInterface $unroutedUrlAssembler

The unrouted URL assembler service.

Methods

__construct(UnroutedUrlAssemblerInterface $url_assembler, RequestContext $request_context)

Constructs a RedirectResponseSubscriber object.

checkRedirectUrl(ResponseEvent $event)

Allows manipulation of the response object when performing a redirect.

string
getDestinationAsAbsoluteUrl(string $destination, string $scheme_and_host)

Converts the passed in destination into an absolute URL.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

__construct(UnroutedUrlAssemblerInterface $url_assembler, RequestContext $request_context)

Constructs a RedirectResponseSubscriber object.

Parameters

UnroutedUrlAssemblerInterface $url_assembler

The unrouted URL assembler service.

RequestContext $request_context

The request context.

checkRedirectUrl(ResponseEvent $event)

Allows manipulation of the response object when performing a redirect.

Parameters

ResponseEvent $event

The Event to process.

protected string getDestinationAsAbsoluteUrl(string $destination, string $scheme_and_host)

Converts the passed in destination into an absolute URL.

Parameters

string $destination

The path for the destination. In case it starts with a slash it should have the base path included already.

string $scheme_and_host

The scheme and host string of the current request.

Return Value

string

The destination as absolute URL.

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.