ILIAS  release_8 Revision v8.24
class.ilRendererFactory.php
Go to the documentation of this file.
1<?php
27{
31 private array $renderers = [];
32
36 public function __construct(array $additional_renderers = [])
37 {
38 $base_renderers = [
41 ];
42 $this->renderers = array_merge($additional_renderers, $base_renderers);
43 }
44
50 public function getRenderers(): array
51 {
52 return $this->renderers;
53 }
54
62 {
63 // check each renderer if it supports that preview object
64 foreach ($this->getRenderers() as $renderer) {
65 if ($renderer->supports($preview)) {
66 return $renderer;
67 }
68 }
69
70 // no matching renderer was found
71 return null;
72 }
73}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRenderers()
Gets an array containing all available preview renderers.
__construct(array $additional_renderers=[])
getRenderer(\ilPreview $preview)
Gets the renderer that is able to create a preview for the specified preview object.
$preview
Definition: imgupload.php:81