ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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...
 
 render ($component, ?Renderer $root=null)
 Render given component. 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. 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 238 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 242 of file Base.php.

248 {
249 $this->with_stub_renderings = array_map(function ($component) {
250 return get_class($component);
252
253 array_walk($this->with_additional_contexts, fn(Component $c) => $this->pushContext($c));
254
255 parent::__construct($component_renderer_loader, $java_script_binding, $language);
256 }
pushContext(Component $component)
Adds a component to the current context stack.
array $with_stub_renderings
Definition: Base.php:240
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References Vendor\Package\$c, $with_stub_renderings, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\UI\Implementation\DefaultRenderer\pushContext().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getContexts()

TestDefaultRenderer::_getContexts ( )

Definition at line 271 of file Base.php.

271 : array
272 {
273 return $this->getContexts();
274 }
getContexts()
Returns the current context stack, where most recently added components are last.

References ILIAS\UI\Implementation\DefaultRenderer\getContexts().

+ Here is the call graph for this function:

◆ _getRendererFor()

TestDefaultRenderer::_getRendererFor ( IComponent  $component)

Definition at line 258 of file Base.php.

258 : Render\ComponentRenderer
259 {
260 return $this->getRendererFor($component);
261 }
getRendererFor(IComponent $component)
Definition: Base.php:263

References getRendererFor().

+ Here is the call graph for this function:

◆ getComponentCanonicalNameAttribute()

TestDefaultRenderer::getComponentCanonicalNameAttribute ( IComponent  $component)

Definition at line 276 of file Base.php.

276 : string
277 {
278 return str_replace(' ', '-', strtolower($component->getCanonicalName()));
279 }

◆ getRendererFor()

TestDefaultRenderer::getRendererFor ( IComponent  $component)

Definition at line 263 of file Base.php.

263 : Render\ComponentRenderer
264 {
265 if (in_array(get_class($component), $this->with_stub_renderings)) {
266 return new TestDummyRenderer();
267 }
268 return parent::getRendererFor($component);
269 }

Referenced by _getRendererFor().

+ Here is the caller graph for this function:

Field Documentation

◆ $with_stub_renderings

array TestDefaultRenderer::$with_stub_renderings = []
protected

Definition at line 240 of file Base.php.

Referenced by __construct().


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