Documentation

AbstractSurrogateFragmentRenderer extends RoutableFragmentRenderer
in package

Implements Surrogate rendering strategy.

Tags
author

Fabien Potencier fabien@symfony.com

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.
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

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

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
see
SurrogateInterface
Return values
mixed

setFragmentPath()

Sets the fragment path that triggers the fragment listener.

public setFragmentPath(string $path) : mixed
Parameters
$path : string
Tags
see
FragmentListener
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

Search results