ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
ExampleRenderer.php
Go to the documentation of this file.
1
<?php
2
18
declare(strict_types=1);
19
20
use
ILIAS\UI\Implementation\Component\Button\Bulky
;
21
use
ILIAS\UI\Implementation\Render\DecoratedRenderer
;
22
use
ILIAS\UI\Renderer
;
23
28
class
ExampleRenderer
extends
DecoratedRenderer
29
{
30
protected
function
manipulateRendering
($component,
Renderer
$root) : ?string
31
{
32
// choose the component you want to manipulate by checking the instance
33
// as closely as possible. please note there may be custom components in
34
// the current chain, which may extend an interface or implementation,
35
// and also run into your manipulation.
36
if
($component instanceof
Bulky
) {
37
// render the component by passing it to the rendering chain of
38
// renderers that come before this renderer.
39
$html = $this->
renderDefault
($component);
40
// manipulate the html to your desire and/or replace it entirely.
41
$html .=
'my custom additions'
;
42
// finally pass the manipulated HTML to the cain, so other renderers
43
// that come after this may manipulate it too.
44
return
$html;
45
}
46
47
// return null to indicate you are not interested in the given component.
48
return
null
;
49
}
50
}
ExampleRenderer
Extend the DecoratedRenderer to align your renderer with other potential renderers in ILIAS,...
Definition:
ExampleRenderer.php:29
ExampleRenderer\manipulateRendering
manipulateRendering($component, Renderer $root)
Manipulates the rendering of one or multiple components by appending, prepending or exchanging their ...
Definition:
ExampleRenderer.php:30
ILIAS\UI\Implementation\Component\Button\Bulky
Bulky Button.
Definition:
Bulky.php:30
ILIAS\UI\Implementation\Render\DecoratedRenderer
Definition:
DecoratedRenderer.php:27
ILIAS\UI\Implementation\Render\DecoratedRenderer\renderDefault
renderDefault($component, ?Renderer $root=null)
Renders the component by default.
Definition:
DecoratedRenderer.php:57
ILIAS\UI\Renderer
An entity that renders components to a string output.
Definition:
Renderer.php:31
docs
development
code-examples
ui-exchange
rendering-manipulations
ExampleRenderer.php
Generated on Sun Oct 19 2025 23:04:55 for ILIAS by
1.9.4 (using
Doxyfile
)