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
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
$debug
private
mixed
$debug
$renderers
private
mixed
$renderers
= []
$requestStack
private
mixed
$requestStack
Methods
__construct()
public
__construct(RequestStack $requestStack[, array<string|int, FragmentRendererInterface> $renderers = [] ][, bool $debug = false ]) : mixed
Parameters
- $requestStack : RequestStack
- $renderers : array<string|int, FragmentRendererInterface> = []
-
An array of FragmentRendererInterface instances
- $debug : bool = false
-
Whether the debug mode is enabled or not
Return values
mixed —addRenderer()
Adds a renderer.
public
addRenderer(FragmentRendererInterface $renderer) : mixed
Parameters
- $renderer : FragmentRendererInterface
Return values
mixed —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
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
Return values
string|null —The Response content or null when the Response is streamed