ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
TestDefaultRenderer Class Reference
+ Inheritance diagram for TestDefaultRenderer:
+ Collaboration diagram for TestDefaultRenderer:

Public Member Functions

 __construct (Render\Loader $component_renderer_loader, JavaScriptBinding $java_script_binding, \ILIAS\Language\Language $language, 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, private \ILIAS\Language\Language $language,)
 
 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,
\ILIAS\Language\Language  $language,
array  $with_stub_renderings = [],
protected array  $with_additional_contexts = [] 
)

Definition at line 230 of file Base.php.

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

236  {
237  $this->with_stub_renderings = array_map(function ($component) {
238  return get_class($component);
240 
241  array_walk($this->with_additional_contexts, fn(Component $c) => $this->pushContext($c));
242 
243  parent::__construct($component_renderer_loader, $java_script_binding, $language);
244  }
pushContext(Component $component)
Adds a component to the current context stack.
$c
Definition: deliver.php:25
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 259 of file Base.php.

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

◆ _getRendererFor()

TestDefaultRenderer::_getRendererFor ( IComponent  $component)

Definition at line 246 of file Base.php.

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

◆ getComponentCanonicalNameAttribute()

TestDefaultRenderer::getComponentCanonicalNameAttribute ( IComponent  $component)

Definition at line 264 of file Base.php.

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

◆ getRendererFor()

TestDefaultRenderer::getRendererFor ( IComponent  $component)

Definition at line 251 of file Base.php.

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

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: