ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\UI\Component\Test\Renderer Class Reference
+ Inheritance diagram for ILIAS\UI\Component\Test\Renderer:
+ Collaboration diagram for ILIAS\UI\Component\Test\Renderer:

Public Member Functions

 __construct (Factory $ui_factory, TemplateFactory $tpl_factory, \ILIAS\Language\Language $lng, JavaScriptBinding $js_binding)
 
 render (Component $component, DefaultRenderer $default_renderer)
 
 registerResources (ResourceRegistry $registry)
 Announce resources this renderer requires. More...
 
- Public Member Functions inherited from ILIAS\UI\Implementation\Render\ComponentRenderer
 render (Component $component, Renderer $default_renderer)
 Render the component if possible and delegate additional rendering to the default_renderer. More...
 

Data Fields

Factory $ui_factory
 
TemplateFactory $tpl_factory
 
ILIAS Language Language $lng
 
JavaScriptBinding $js_binding
 

Private Member Functions

 bindOnloadCode (\ILIAS\UI\Component\JavaScriptBindable $component)
 

Detailed Description

Definition at line 58 of file TestComponent.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\UI\Component\Test\Renderer::__construct ( Factory  $ui_factory,
TemplateFactory  $tpl_factory,
\ILIAS\Language\Language  $lng,
JavaScriptBinding  $js_binding 
)
final

Definition at line 65 of file TestComponent.php.

References $lng, and ILIAS\Repository\lng().

66  {
67  $this->ui_factory = $ui_factory;
68  $this->tpl_factory = $tpl_factory;
69  $this->lng = $lng;
70  $this->js_binding = $js_binding;
71  }
ILIAS Language Language $lng
+ Here is the call graph for this function:

Member Function Documentation

◆ bindOnloadCode()

ILIAS\UI\Component\Test\Renderer::bindOnloadCode ( \ILIAS\UI\Component\JavaScriptBindable  $component)
private

Definition at line 90 of file TestComponent.php.

90  : void
91  {
92  $binder = $component->getOnLoadCode();
93  $this->js_binding->addOnLoadCode($binder("id"));
94  }

◆ registerResources()

ILIAS\UI\Component\Test\Renderer::registerResources ( ResourceRegistry  $registry)

Announce resources this renderer requires.

Implements ILIAS\UI\Implementation\Render\ComponentRenderer.

Definition at line 85 of file TestComponent.php.

References ILIAS\UI\Implementation\Render\ResourceRegistry\register().

85  : void
86  {
87  $registry->register("test.js");
88  }
+ Here is the call graph for this function:

◆ render()

ILIAS\UI\Component\Test\Renderer::render ( Component  $component,
DefaultRenderer  $default_renderer 
)

Definition at line 73 of file TestComponent.php.

References $id, and ILIAS\UI\Component\Test\TestComponent\$text.

73  : string
74  {
75  if ($component instanceof JSTestComponent) {
76  $text = $component->text;
77  $component = $component->withAdditionalOnLoadCode(function ($id) use ($text) {
78  return "id:$text.$id content:$text";
79  });
80  $this->bindOnloadCode($component);
81  }
82  return $component->text;
83  }
bindOnloadCode(\ILIAS\UI\Component\JavaScriptBindable $component)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

Field Documentation

◆ $js_binding

JavaScriptBinding ILIAS\UI\Component\Test\Renderer::$js_binding

Definition at line 63 of file TestComponent.php.

◆ $lng

ILIAS Language Language ILIAS\UI\Component\Test\Renderer::$lng

Definition at line 62 of file TestComponent.php.

◆ $tpl_factory

TemplateFactory ILIAS\UI\Component\Test\Renderer::$tpl_factory

Definition at line 61 of file TestComponent.php.

◆ $ui_factory

Factory ILIAS\UI\Component\Test\Renderer::$ui_factory

Definition at line 60 of file TestComponent.php.


The documentation for this class was generated from the following file: