api/symfony/Component/HttpKernel/Fragment/FragmentHandler.yaml
2024-09-26 02:03:21 -07:00

104 lines
3 KiB
YAML

name: FragmentHandler
class_comment: '# * 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.
# *
# * @author Fabien Potencier <fabien@symfony.com>
# *
# * @see FragmentRendererInterface'
dependencies:
- name: RequestStack
type: class
source: Symfony\Component\HttpFoundation\RequestStack
- name: Response
type: class
source: Symfony\Component\HttpFoundation\Response
- name: StreamedResponse
type: class
source: Symfony\Component\HttpFoundation\StreamedResponse
- name: ControllerReference
type: class
source: Symfony\Component\HttpKernel\Controller\ControllerReference
- name: HttpException
type: class
source: Symfony\Component\HttpKernel\Exception\HttpException
properties: []
methods:
- name: __construct
visibility: public
parameters:
- name: requestStack
- name: renderers
default: '[]'
- name: debug
default: 'false'
comment: "# * Renders a URI that represents a resource fragment.\n# *\n# * This\
\ class handles the rendering of resource fragments that are included into\n#\
\ * a main resource. The handling of the rendering is managed by specialized renderers.\n\
# *\n# * @author Fabien Potencier <fabien@symfony.com>\n# *\n# * @see FragmentRendererInterface\n\
# */\n# class FragmentHandler\n# {\n# /** @var array<string, FragmentRendererInterface>\
\ */\n# private array $renderers = [];\n# \n# /**\n# * @param FragmentRendererInterface[]\
\ $renderers An array of FragmentRendererInterface instances\n# * @param bool\
\ $debug Whether the debug mode is enabled or not"
- name: addRenderer
visibility: public
parameters:
- name: renderer
comment: '# * Adds a renderer.'
- name: render
visibility: public
parameters:
- name: uri
- name: renderer
default: '''inline'''
- name: options
default: '[]'
comment: '# * Renders a URI and returns the Response content.
# *
# * Available options:
# *
# * * ignore_errors: true to return an empty string in case of an error
# *
# * @throws \InvalidArgumentException when the renderer does not exist
# * @throws \LogicException when no main request is being handled'
- name: deliver
visibility: protected
parameters:
- name: response
comment: '# * Delivers the Response as a string.
# *
# * When the Response is a StreamedResponse, the content is streamed immediately
# * instead of being returned.
# *
# * @return string|null The Response content or null when the Response is streamed
# *
# * @throws \RuntimeException when the Response is not successful'
traits:
- Symfony\Component\HttpFoundation\RequestStack
- Symfony\Component\HttpFoundation\Response
- Symfony\Component\HttpFoundation\StreamedResponse
- Symfony\Component\HttpKernel\Controller\ControllerReference
- Symfony\Component\HttpKernel\Exception\HttpException
interfaces: []