ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 229 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 233 of file Base.php.

239 {
240 $this->with_stub_renderings = array_map(function ($component) {
241 return get_class($component);
243
244 array_walk($this->with_additional_contexts, fn(Component $c) => $this->pushContext($c));
245
246 parent::__construct($component_renderer_loader, $java_script_binding, $language);
247 }
pushContext(Component $component)
Adds a component to the current context stack.
array $with_stub_renderings
Definition: Base.php:231
$c
Definition: deliver.php:25
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $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 262 of file Base.php.

262 : array
263 {
264 return $this->getContexts();
265 }
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 249 of file Base.php.

249 : Render\ComponentRenderer
250 {
251 return $this->getRendererFor($component);
252 }
getRendererFor(IComponent $component)
Definition: Base.php:254

References getRendererFor().

+ Here is the call graph for this function:

◆ getComponentCanonicalNameAttribute()

TestDefaultRenderer::getComponentCanonicalNameAttribute ( IComponent  $component)

Definition at line 267 of file Base.php.

267 : string
268 {
269 return str_replace(' ', '-', strtolower($component->getCanonicalName()));
270 }

◆ getRendererFor()

TestDefaultRenderer::getRendererFor ( IComponent  $component)

Definition at line 254 of file Base.php.

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

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 231 of file Base.php.

Referenced by __construct().


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