ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
TestDefaultRenderer Class Reference
+ Inheritance diagram for TestDefaultRenderer:
+ Collaboration diagram for TestDefaultRenderer:

Public Member Functions

 __construct (Render\Loader $component_renderer_loader, JavaScriptBinding $java_script_binding, array $with_stub_renderings=[], protected array $with_additional_contexts=[],)
 
 _getRendererFor (IComponent $component)
 
 getRendererFor (IComponent $component)
 
 _getContexts ()
 
 getComponentCanonicalNameAttribute (IComponent $component)
 
- Public Member Functions inherited from ILIAS\UI\Implementation\DefaultRenderer
 __construct (private Render\Loader $component_renderer_loader, private JavaScriptBinding $java_script_binding,)
 
 render ($component, ?Renderer $root=null)
 Render given component.If an array of components is passed, this method returns a concatenated output of each rendered component, in the same order as given in the array
Parameters
Component|Component[]$component
?Renderer$root of renderers in the chain to be used for rendering sub components.
Returns
string
More...
 
 renderAsync ($component, ?Renderer $root=null)
 Same as render, except that this version also returns any javascript code bound to the on load event, wrapped in a script tag.All javascript code stored for rendering will be removed after this output so it will not be rendered twice if render async is called multiple times.
Parameters
Component|Component[]$component
?Renderer$root of renderers in the chain to be used for rendering sub components.
Returns
string
More...
 

Protected Attributes

array $with_stub_renderings = []
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\UI\Implementation\DefaultRenderer
 getRendererFor (Component $component)
 Get a renderer for a certain Component class. More...
 
 getContexts ()
 Returns the current context stack, where most recently added components are last. More...
 
 pushContext (Component $component)
 Adds a component to the current context stack. More...
 
 popContext ()
 Removes the most recently added component from the current context stack. More...
 

Detailed Description

Definition at line 226 of file Base.php.

Constructor & Destructor Documentation

◆ __construct()

TestDefaultRenderer::__construct ( Render\Loader  $component_renderer_loader,
JavaScriptBinding  $java_script_binding,
array  $with_stub_renderings = [],
protected array  $with_additional_contexts = [] 
)

Definition at line 230 of file Base.php.

References $c, and ILIAS\GlobalScreen\Provider\__construct().

235  {
236  $this->with_stub_renderings = array_map(function ($component) {
237  return get_class($component);
239 
240  array_walk($this->with_additional_contexts, fn(Component $c) => $this->pushContext($c));
241 
242  parent::__construct($component_renderer_loader, $java_script_binding);
243  }
pushContext(Component $component)
Adds a component to the current context stack.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: deliver.php:9
array $with_stub_renderings
Definition: Base.php:228
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getContexts()

TestDefaultRenderer::_getContexts ( )

Definition at line 258 of file Base.php.

258  : array
259  {
260  return $this->getContexts();
261  }
getContexts()
Returns the current context stack, where most recently added components are last. ...

◆ _getRendererFor()

TestDefaultRenderer::_getRendererFor ( IComponent  $component)

Definition at line 245 of file Base.php.

245  : Render\ComponentRenderer
246  {
247  return $this->getRendererFor($component);
248  }
getRendererFor(IComponent $component)
Definition: Base.php:250

◆ getComponentCanonicalNameAttribute()

TestDefaultRenderer::getComponentCanonicalNameAttribute ( IComponent  $component)

Definition at line 263 of file Base.php.

263  : string
264  {
265  return str_replace(' ', '-', strtolower($component->getCanonicalName()));
266  }

◆ getRendererFor()

TestDefaultRenderer::getRendererFor ( IComponent  $component)

Definition at line 250 of file Base.php.

250  : Render\ComponentRenderer
251  {
252  if (in_array(get_class($component), $this->with_stub_renderings)) {
253  return new TestDummyRenderer();
254  }
255  return parent::getRendererFor($component);
256  }

Field Documentation

◆ $with_stub_renderings

array TestDefaultRenderer::$with_stub_renderings = []
protected

Definition at line 228 of file Base.php.


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