ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ExampleRenderer.php
Go to the documentation of this file.
1 <?php
2 
6 
7 //inherit from DecoratedRender to align your renderer with other potential renders in ILIAS to allow manipulations from
8 //different sources to be chained behind each other.
10 {
11  //define your manipulations. This example add an "A" before every button in ILIAS
12  protected function manipulateRendering($component, Renderer $root) : ?string
13  {
14  //select the component you want to manipulate
15  if ($component instanceof Bulky) {
16  //if you need the origin rendering (e.g. for append or prepend) you can access it by calling renderDefault()
17  return "A" . $this->renderDefault($component, $root);
18  }
19 
20  //skip components that are not important to you with returning null
21  return null;
22  }
23 }
An entity that renders components to a string output.
Definition: Renderer.php:14
renderDefault($component, ?Renderer $root=null)
Renders the component by default.
manipulateRendering($component, Renderer $root)