Documentation

FragmentHandler
in package

Renders a URI that represents a resource fragment.

This class handles the rendering of resource fragments that are included into a main resource. The handling of the rendering is managed by specialized renderers.

Tags
author

Fabien Potencier fabien@symfony.com

see
FragmentRendererInterface

Table of Contents

$debug  : mixed
$renderers  : mixed
$requestStack  : mixed
__construct()  : mixed
addRenderer()  : mixed
Adds a renderer.
render()  : string|null
Renders a URI and returns the Response content.
deliver()  : string|null
Delivers the Response as a string.

Properties

Methods

render()

Renders a URI and returns the Response content.

public render(string|ControllerReference $uri[, string $renderer = 'inline' ][, array<string|int, mixed> $options = [] ]) : string|null

Available options:

  • ignore_errors: true to return an empty string in case of an error
Parameters
$uri : string|ControllerReference

A URI as a string or a ControllerReference instance

$renderer : string = 'inline'
$options : array<string|int, mixed> = []
Tags
throws
InvalidArgumentException

when the renderer does not exist

throws
LogicException

when no main request is being handled

Return values
string|null

deliver()

Delivers the Response as a string.

protected deliver(Response $response) : string|null

When the Response is a StreamedResponse, the content is streamed immediately instead of being returned.

Parameters
$response : Response
Tags
throws
RuntimeException

when the Response is not successful

Return values
string|null

The Response content or null when the Response is streamed

Search results