class LazyLoadingFragmentHandler extends FragmentHandler
Lazily loads fragment renderers from the dependency injection container.
__construct(ContainerInterface $container, RequestStack $requestStack, bool $debug = false) | ||
addRenderer(FragmentRendererInterface $renderer) Adds a renderer. | from FragmentHandler | |
string|null | render(string|ControllerReference $uri, string $renderer = 'inline', array $options = array()) Renders a URI and returns the Response content. | |
string|null | deliver(Response $response) Delivers the Response as a string. | from FragmentHandler |
ContainerInterface | $container | |
RequestStack | $requestStack | The Request stack that controls the lifecycle of requests |
bool | $debug | Whether the debug mode is enabled or not |
Adds a renderer.
FragmentRendererInterface | $renderer |
Renders a URI and returns the Response content.
Available options:
string|ControllerReference | $uri | A URI as a string or a ControllerReference instance |
string | $renderer | The renderer name |
array | $options | An array of options |
string|null | The Response content or null when the Response is streamed |
InvalidArgumentException | when the renderer does not exist |
LogicException | when no master request is being handled |
Delivers the Response as a string.
When the Response is a StreamedResponse, the content is streamed immediately instead of being returned.
Response | $response |
string|null | The Response content or null when the Response is streamed |
RuntimeException | when the Response is not successful |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/HttpKernel/DependencyInjection/LazyLoadingFragmentHandler.html