class HtmlResponsePlaceholderStrategySubscriber implements EventSubscriberInterface (View source)

HTML response subscriber to allow for different placeholder strategies.

This allows core and contrib to coordinate how to render placeholders; e.g. an EsiRenderStrategy could replace the placeholders with ESI tags, while e.g. a BigPipeRenderStrategy could store the placeholders in a BigPipe service and render them after the main content has been sent to the client.

Properties

protected PlaceholderStrategyInterface $placeholderStrategy

The placeholder strategy to use.

Methods

__construct(PlaceholderStrategyInterface $placeholder_strategy)

Constructs a HtmlResponsePlaceholderStrategySubscriber object.

onRespond(ResponseEvent $event)

Processes placeholders for HTML responses.

static 
getSubscribedEvents()

{@inheritdoc}

Details

__construct(PlaceholderStrategyInterface $placeholder_strategy)

Constructs a HtmlResponsePlaceholderStrategySubscriber object.

Parameters

PlaceholderStrategyInterface $placeholder_strategy

The placeholder strategy to use.

onRespond(ResponseEvent $event)

Processes placeholders for HTML responses.

Parameters

ResponseEvent $event

The event to process.

static getSubscribedEvents()

{@inheritdoc}