EsiFragmentRenderer
extends AbstractSurrogateFragmentRenderer
in package
Implements the ESI rendering strategy.
Tags
Table of Contents
- $inlineStrategy : mixed
- $signer : mixed
- $surrogate : mixed
- __construct() : mixed
- The "fallback" strategy when surrogate is not available should always be an instance of InlineFragmentRenderer.
- getName() : mixed
- {@inheritdoc}
- render() : mixed
- {@inheritdoc}
- setFragmentPath() : mixed
- Sets the fragment path that triggers the fragment listener.
- generateFragmentUri() : string
- Generates a fragment URI for a given controller.
- containsNonScalars() : bool
- generateSignedFragmentUri() : string
Properties
$inlineStrategy
private
mixed
$inlineStrategy
$signer
private
mixed
$signer
$surrogate
private
mixed
$surrogate
Methods
__construct()
The "fallback" strategy when surrogate is not available should always be an instance of InlineFragmentRenderer.
public
__construct(SurrogateInterface|null $surrogate, FragmentRendererInterface $inlineStrategy[, UriSigner|null $signer = null ]) : mixed
Parameters
- $surrogate : SurrogateInterface|null
- $inlineStrategy : FragmentRendererInterface
-
The inline strategy to use when the surrogate is not supported
- $signer : UriSigner|null = null
Return values
mixed —getName()
{@inheritdoc}
public
getName() : mixed
Return values
mixed —render()
{@inheritdoc}
public
render(mixed $uri, Request $request[, array<string|int, mixed> $options = [] ]) : mixed
Note that if the current Request has no surrogate capability, this method falls back to use the inline rendering strategy.
Additional available options:
- alt: an alternative URI to render in case of an error
- comment: a comment to add when returning the surrogate tag
Note, that not all surrogate strategies support all options. For now 'alt' and 'comment' are only supported by ESI.
Parameters
- $uri : mixed
- $request : Request
- $options : array<string|int, mixed> = []
Tags
Return values
mixed —setFragmentPath()
Sets the fragment path that triggers the fragment listener.
public
setFragmentPath(string $path) : mixed
Parameters
- $path : string
Tags
Return values
mixed —generateFragmentUri()
Generates a fragment URI for a given controller.
protected
generateFragmentUri(ControllerReference $reference, Request $request[, bool $absolute = false ][, bool $strict = true ]) : string
Parameters
- $reference : ControllerReference
- $request : Request
- $absolute : bool = false
-
Whether to generate an absolute URL or not
- $strict : bool = true
-
Whether to allow non-scalar attributes or not
Return values
string —containsNonScalars()
private
containsNonScalars(array<string|int, mixed> $values) : bool
Parameters
- $values : array<string|int, mixed>
Return values
bool —generateSignedFragmentUri()
private
generateSignedFragmentUri(ControllerReference $uri, Request $request) : string
Parameters
- $uri : ControllerReference
- $request : Request