Documentation
Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'
Legacy
Description
- Purpose
- This component is used to wrap an existing ILIAS UI element into a UI component. This is useful if a container of the UI components needs to contain content that is not yet implement in the centralized UI components.
- Composition
- The legacy component contains html or any other content as string.
Rules
- Usage
- This component MUST only be used to ensure backwards compatibility with existing UI elements in ILIAS, therefore it SHOULD only contain Elements which cannot be generated using other UI Components from the UI Service.
Example 1: Base
Legacy Content
<?php declare(strict_types=1); namespace ILIAS\UI\examples\Legacy; /* Copyright (c) 2016 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */ function base() { //Init Factory and Renderer global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); //Init Component $legacy = $f->legacy("Legacy Content"); //Render return $renderer->render($legacy); }
Example 2: Inside panel
Panel Title
Legacy Content
<?php declare(strict_types=1); namespace ILIAS\UI\examples\Legacy; /* Copyright (c) 2016 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */ function inside_panel() { //Init Factory and Renderer global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); //Init Component $legacy = $f->legacy("Legacy Content"); $panel = $f->panel()->standard("Panel Title", $legacy); //Render return $renderer->render($panel); }
Relations
- Parents
- UIComponent