19 declare(strict_types=1);
36 $tc = $DIC->ui()->factory()->toast()->container();
39 $DIC->ui()->factory()->toast()->standard(
41 $DIC->ui()->factory()->symbol()->icon()->standard(
'info',
'Example')
43 ->withAdditionalLink($DIC->ui()->factory()->link()->standard(
'ILIAS',
'https://www.ilias.de'))
44 ->withAdditionalLink($DIC->ui()->factory()->link()->standard(
'GitHub',
'https://www.github.com'))
47 $toasts = base64_encode($DIC->ui()->renderer()->renderAsync($toasts));
48 $button = $DIC->ui()->factory()->button()->standard($DIC->language()->txt(
'show'),
'');
49 $button = $button->withAdditionalOnLoadCode(
function (
$id) use ($toasts) {
50 return "$id.addEventListener('click', () => { 51 $id.parentNode.querySelector('.il-toast-container').innerHTML = atob('$toasts'); 52 $id.parentNode.querySelector('.il-toast-container').querySelectorAll('script').forEach(element => { 53 let newScript = document.createElement('script'); 54 newScript.innerHTML = element.innerHTML; 55 element.parentNode.appendChild(newScript); 60 return $DIC->ui()->renderer()->render([$button,$tc]);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
with_additional_links()
description: > Example for rendering a standard toast with additional links.