ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
show_card_in_popover.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
19 {
20  global $DIC;
21 
22  // This example shows how to render a card containing an image and a descriptive list inside a popover.
23  $factory = $DIC->ui()->factory();
24  $renderer = $DIC->ui()->renderer();
25 
26  $image = $factory->image()->responsive("./assets/images/logo/HeaderIcon.svg", "Thumbnail Example");
27  $card = $factory->card()->standard("Title", $image)->withSections(array($factory->legacy("Hello World, I'm a card")));
28  $popover = $factory->popover()->standard($card)->withTitle('Card');
29  $button = $factory->button()->standard('Show Card', '#')
30  ->withOnClick($popover->getShowSignal());
31 
32  return $renderer->render([$popover, $button]);
33 }
$renderer
global $DIC
Definition: shib_login.php:25
show_card_in_popover()
description: > Example for rendering a standard popover.