ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PageContent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
28class PageContent implements PageFragment
29{
33 public function __construct(private readonly string $title, private readonly array $components)
34 {
35 }
36
37 public function render(ilGlobalTemplateInterface $main_template, Renderer $renderer): string
38 {
39 $main_template->setTitle($this->title);
40 return $renderer->render($this->components);
41 }
42
43 public function withOnScreenMessage(string $type, string $txt, bool $keep = false): PageFragment
44 {
45 return new ShowOnScreenMessage($this, $type, $txt, $keep);
46 }
47}
$components
$renderer
__construct(private readonly string $title, private readonly array $components)
Definition: PageContent.php:33
render(ilGlobalTemplateInterface $main_template, Renderer $renderer)
Definition: PageContent.php:37
withOnScreenMessage(string $type, string $txt, bool $keep=false)
Definition: PageContent.php:43
$txt
Definition: error.php:31
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
A component is the most general form of an entity in the UI.
Definition: Component.php:28
An entity that renders components to a string output.
Definition: Renderer.php:31
Class ilChatroomConfigFileHandler \ILIAS\Chatroom\classes.