ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
show_a_single_image.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
19 {
20  global $DIC;
21  $factory = $DIC->ui()->factory();
22  $renderer = $DIC->ui()->renderer();
23  $image = $factory->image()->responsive("assets/ui-examples/images/Image/mountains.jpg", "Image source: https://stocksnap.io, Creative Commons CC0 license");
24  $page = $factory->modal()->lightboxImagePage($image, 'Mountains');
25  $modal = $factory->modal()->lightbox($page);
26  $button = $factory->button()->standard('Show Image', '')
27  ->withOnClick($modal->getShowSignal());
28 
29  return $renderer->render([$button, $modal]);
30 }
$renderer
global $DIC
Definition: shib_login.php:25
show_a_single_image()
description: > Example for rendering a lightbox image page modal with a single image.