RendererRegistry implements SingletonInterface
Registry for file renderers, which are registered as tagged services via the #[AsFileRenderer] attribute or the 'fal.file_renderer' service tag. Renderers are ordered by their tag priority, a renderer with a higher priority is asked first whether it can render a file.
not part of TYPO3's Core API. Register file renderers via the #[AsFileRenderer] attribute instead.
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $instances : array<string|int, FileRendererInterface>|null
- Instance cache for renderer classes
- $renderers : iterable<string|int, mixed>
Methods
- __construct() : mixed
- getRenderer() : FileRendererInterface|null
- Get matching renderer with highest priority
- registerRendererClass() : void
- getRendererInstances() : array<string|int, FileRendererInterface>
- Get all registered renderer instances
Properties
$instances
Instance cache for renderer classes
protected
array<string|int, FileRendererInterface>|null
$instances
= null
$renderers read-only
protected
iterable<string|int, mixed>
$renderers
= []
Methods
__construct()
public
__construct([iterable<string|int, FileRendererInterface> $renderers = [] ]) : mixed
Parameters
- $renderers : iterable<string|int, FileRendererInterface> = []
getRenderer()
Get matching renderer with highest priority
public
getRenderer(FileInterface $file) : FileRendererInterface|null
Parameters
- $file : FileInterface
Return values
FileRendererInterface|nullregisterRendererClass()
public
registerRendererClass(string $className) : void
since TYPO3 v15.0, this method is a no-op and will be removed in TYPO3 v16.0. Register the renderer as a tagged service using the #[AsFileRenderer] attribute instead.
Parameters
- $className : string
getRendererInstances()
Get all registered renderer instances
protected
getRendererInstances() : array<string|int, FileRendererInterface>