ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
TestDefaultRenderer Class Reference
+ Inheritance diagram for TestDefaultRenderer:
+ Collaboration diagram for TestDefaultRenderer:

Public Member Functions

 __construct (Render\Loader $component_renderer_loader, $with_stub_renderings=[])
 
 _getRendererFor (IComponent $component)
 
 getRendererFor (IComponent $component)
 
 _getContexts ()
 
- Public Member Functions inherited from ILIAS\UI\Implementation\DefaultRenderer
 __construct (Render\Loader $component_renderer_loader)
 
 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...
 
 withAdditionalContext (Component $context)
 Get a new renderer with an additional context.A context makes it possible to use another renderer for (some) components when they are renderer as subcomponents of a certain components. The use case that spawned this functionality is the observation, that e.g. items representing repository objects are renderer in different lists, where the individual items look different every time but are morally the same item. Another use case could be a special rendering of input fields in filters over tables.If a component wants to render itself differently in different contexts, it must implement a RendererFactory. The class contains directions how to do that.
Parameters
Component$context
Returns
Renderer
More...
 

Protected Attributes

 $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...
 
 getJSCodeForAsyncRenderingFor (Component $component)
 Get JS-Code for asynchronous rendering of component. More...
 
 getContexts ()
 Get the contexts that are added via withAdditionalContext where most recently added contexts come last. More...
 

Detailed Description

Definition at line 173 of file Base.php.

Constructor & Destructor Documentation

◆ __construct()

TestDefaultRenderer::__construct ( Render\Loader  $component_renderer_loader,
  $with_stub_renderings = [] 
)

Definition at line 180 of file Base.php.

References ILIAS\GlobalScreen\Provider\__construct().

181  {
182  $this->with_stub_renderings = array_map(function ($component) {
183  return get_class($component);
186  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getContexts()

TestDefaultRenderer::_getContexts ( )

Definition at line 201 of file Base.php.

202  {
203  return $this->getContexts();
204  }
getContexts()
Get the contexts that are added via withAdditionalContext where most recently added contexts come las...

◆ _getRendererFor()

TestDefaultRenderer::_getRendererFor ( IComponent  $component)

Definition at line 188 of file Base.php.

189  {
190  return $this->getRendererFor($component);
191  }
getRendererFor(IComponent $component)
Definition: Base.php:193

◆ getRendererFor()

TestDefaultRenderer::getRendererFor ( IComponent  $component)

Definition at line 193 of file Base.php.

194  {
195  if (in_array(get_class($component), $this->with_stub_renderings)) {
196  return new TestDummyRenderer();
197  }
198  return parent::getRendererFor($component);
199  }

Field Documentation

◆ $with_stub_renderings

TestDefaultRenderer::$with_stub_renderings = []
protected

Definition at line 178 of file Base.php.


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