‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Resource\Rendering\RendererRegistry Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Rendering\RendererRegistry:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 registerRendererClass ($className)
 
FileRendererInterface[] getRendererInstances ()
 
FileRendererInterface null getRenderer (FileInterface $file)
 

Protected Member Functions

FileRendererInterface createRendererInstance ($className)
 
int compareRendererPriority (FileRendererInterface $rendererA, FileRendererInterface $rendererB)
 

Protected Attributes

array $classNames = array( )
 
FileRendererInterface[] $instances
 

Detailed Description

Definition at line 22 of file RendererRegistry.php.

Member Function Documentation

◆ compareRendererPriority()

int TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::compareRendererPriority ( FileRendererInterface  $rendererA,
FileRendererInterface  $rendererB 
)
protected

Compare the priority of two renderer classes Is used for sorting array of Renderer instances by priority We want the result to be ordered from high to low so a higher priority comes before a lower.

Returns
‪int -1 a > b, 0 a == b, 1 a < b

Definition at line 98 of file RendererRegistry.php.

References TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface\getPriority().

◆ createRendererInstance()

FileRendererInterface TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::createRendererInstance (   $className)
protected

Create an instance of a certain renderer class

Parameters
string$className
Returns
FileRendererInterface

Definition at line 85 of file RendererRegistry.php.

Referenced by TYPO3\CMS\Core\Resource\Rendering\RendererRegistry\getRendererInstances().

◆ getRenderer()

FileRendererInterface null TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::getRenderer ( FileInterface  $file)

Get matching renderer with highest priority

Returns
‪FileRendererInterface|null

Definition at line 108 of file RendererRegistry.php.

References TYPO3\CMS\Core\Resource\Rendering\RendererRegistry\getRendererInstances().

◆ getRendererInstances()

◆ registerRendererClass()

TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::registerRendererClass (   $className)

Allows to register a Renderer class

Parameters
string$className
Exceptions

Definition at line 42 of file RendererRegistry.php.

Member Data Documentation

◆ $classNames

array TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::$classNames = array( )
protected

Registered class names

Definition at line 28 of file RendererRegistry.php.

Referenced by TYPO3\CMS\Core\Resource\Rendering\RendererRegistry\getRendererInstances().

◆ $instances

FileRendererInterface [] TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::$instances
protected

Instance cache for renderer classes

Definition at line 34 of file RendererRegistry.php.

Referenced by TYPO3\CMS\Core\Resource\Rendering\RendererRegistry\getRendererInstances().