ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DecoratedRenderer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
26 abstract class DecoratedRenderer implements Renderer
27 {
28  private $default;
29 
30  public function __construct(Renderer $default)
31  {
32  $this->default = $default;
33  }
34 
42  abstract protected function manipulateRendering($component, Renderer $root): ?string;
43 
48  protected function manipulateAsyncRendering($component, Renderer $root): ?string
49  {
50  return null;
51  }
52 
57  final protected function renderDefault($component, ?Renderer $root = null): string
58  {
59  $root = $root ?? $this;
60  return $this->default->render($component, $root);
61  }
62 
66  final public function render($component, ?Renderer $root = null): string
67  {
68  $root = $root ?? $this;
69  return $this->manipulateRendering($component, $root) ?? $this->default->render($component, $root);
70  }
71 
75  final public function renderAsync($component, ?Renderer $root = null): string
76  {
77  $root = $root ?? $this;
78  return $this->manipulateAsyncRendering($component, $root) ?? $this->default->renderAsync($component, $root);
79  }
80 }
render($component, ?Renderer $root=null)
Render given component.
renderAsync($component, ?Renderer $root=null)
Same as render, except that this version also returns any javascript code bound to the on load event...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renderDefault($component, ?Renderer $root=null)
Renders the component by default.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
manipulateAsyncRendering($component, Renderer $root)
Manipulates the async Rendering separately if needed.
render($component, ?Renderer $root=null)
Render given component.If an array of components is passed, this method returns a concatenated output...
manipulateRendering($component, Renderer $root)
Manipulates the rendering of one or multiple components by appending, prepending or exchanging their ...