ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
HelloWorldRenderer Class Reference

Extend the DecoratedRenderer to align your renderer with other potential renderers in ILIAS, and allow manipulations from different sources to be chained to one another. More...

+ Inheritance diagram for HelloWorldRenderer:
+ Collaboration diagram for HelloWorldRenderer:

Public Member Functions

 __construct (ResourceRegistry $resource_registry, Renderer $default)
 
- Public Member Functions inherited from ILIAS\UI\Implementation\Render\DecoratedRenderer
 __construct (Renderer $default)
 
 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 Member Functions

 manipulateRendering ($component, Renderer $root)
 
 registerResources (ResourceRegistry $resource_registry)
 
- Protected Member Functions inherited from ILIAS\UI\Implementation\Render\DecoratedRenderer
 manipulateRendering ($component, Renderer $root)
 Manipulates the rendering of one or multiple components by appending, prepending or exchanging their rendered content with custom adjustments. More...
 
 manipulateAsyncRendering ($component, Renderer $root)
 Manipulates the async Rendering separately if needed. More...
 
 renderDefault ($component, ?Renderer $root=null)
 Renders the component by default. More...
 

Detailed Description

Extend the DecoratedRenderer to align your renderer with other potential renderers in ILIAS, and allow manipulations from different sources to be chained to one another.

Definition at line 30 of file HelloWorldRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

HelloWorldRenderer::__construct ( ResourceRegistry  $resource_registry,
Renderer  $default 
)

Definition at line 32 of file HelloWorldRenderer.php.

References ILIAS\GlobalScreen\Provider\__construct(), and registerResources().

33  {
34  $this->registerResources($resource_registry);
35  parent::__construct($default);
36  }
registerResources(ResourceRegistry $resource_registry)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ manipulateRendering()

HelloWorldRenderer::manipulateRendering (   $component,
Renderer  $root 
)
protected

Definition at line 38 of file HelloWorldRenderer.php.

References null.

38  : ?string
39  {
40  // if the component is an instance of our custom implementation, we can
41  // render it according to our business logic and pass it to the chain.
42  if ($component instanceof HelloWorld) {
43  return "<p>{$component->getGreeting()}</p>";
44  }
45 
46  // return null to indicate you are not interested in the given component.
47  return null;
48  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Some very basic component implementation.
Definition: HelloWorld.php:26

◆ registerResources()

HelloWorldRenderer::registerResources ( ResourceRegistry  $resource_registry)
protected

Definition at line 50 of file HelloWorldRenderer.php.

References ILIAS\UI\Implementation\Render\ResourceRegistry\register().

Referenced by __construct().

50  : void
51  {
52  $resource_registry->register('some/asset/path');
53  }
register(string $name)
Add a dependency.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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