EsiFragmentRenderer
extends AbstractSurrogateFragmentRenderer
in package
Implements the ESI rendering strategy.
Tags
Table of Contents
Properties
- $inlineStrategy : mixed
- $signer : mixed
- $surrogate : mixed
Methods
- __construct() : mixed
- The "fallback" strategy when surrogate is not available should always be an instance of InlineFragmentRenderer.
- getName() : string
- {@inheritdoc}
- render() : Response
- {@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 $surrogate = null ], FragmentRendererInterface $inlineStrategy[, UriSigner $signer = null ]) : mixed
Parameters
- $surrogate : SurrogateInterface = null
- $inlineStrategy : FragmentRendererInterface
-
The inline strategy to use when the surrogate is not supported
- $signer : UriSigner = null
getName()
{@inheritdoc}
public
getName() : string
Return values
stringrender()
{@inheritdoc}
public
render(string|ControllerReference $uri, Request $request[, array<string|int, mixed> $options = [] ]) : Response
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 : string|ControllerReference
- $request : Request
- $options : array<string|int, mixed> = []
Tags
Return values
ResponsesetFragmentPath()
Sets the fragment path that triggers the fragment listener.
public
setFragmentPath(string $path) : mixed
Parameters
- $path : string
Tags
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
stringcontainsNonScalars()
private
containsNonScalars(array<string|int, mixed> $values) : bool
Parameters
- $values : array<string|int, mixed>
Return values
boolgenerateSignedFragmentUri()
private
generateSignedFragmentUri(ControllerReference $uri, Request $request) : string
Parameters
- $uri : ControllerReference
- $request : Request