ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilNewsRendererFactory.php
Go to the documentation of this file.
1<?php
2
24{
26 protected static array $renderer = [];
27
28 public static function getRenderer(string $a_context_obj_type): ilNewsRendererGUI
29 {
30 global $DIC;
31
32 if (!isset(self::$renderer[$a_context_obj_type])) {
33 $obj_def = $DIC["objDefinition"];
34
35 $comp = $obj_def->getComponentForType($a_context_obj_type);
36 $class = $obj_def->getClassName($a_context_obj_type);
37
38 $class = "il" . $class . "NewsRendererGUI";
39 $type_renderer_path = "./" . $comp . "/classes/class." . $class . ".php";
40 if (is_file($type_renderer_path)) {
41 $rend = new $class();
42 } else {
43 $rend = new ilNewsDefaultRendererGUI();
44 }
45 self::$renderer[$a_context_obj_type] = $rend;
46 }
47
48 return self::$renderer[$a_context_obj_type];
49 }
50}
$renderer
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...
static getRenderer(string $a_context_obj_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26