description: > Example for rendering a lightbox modal.
39{
41 $factory =
$DIC->ui()->factory();
43 $image = $factory->image()->responsive('assets/ui-examples/images/Image/mountains.jpg', 'Nice view on some mountains');
44 $page = $factory->modal()->lightboxImagePage(
45 $image,
46 'Mountains',
47 'Image source: https://stocksnap.io, Creative Commons CC0 license'
48 );
49
50 $page2 = $factory->modal()->lightboxTextPage('Some text content you have to agree on!', 'User Agreement');
51
52 $image2 = $factory->image()->responsive('assets/ui-examples/images/Image/sanfrancisco.jpg', 'The golden gate bridge');
53 $page3 = $factory->modal()->lightboxImagePage(
54 $image2,
55 'San Francisco',
56 'Image source: https://stocksnap.io, Creative Commons CC0 license'
57 );
58
59 $page4 = $factory->modal()->lightboxTextPage(
60 'Another text content you have to agree on!',
61 'Data Privacy Statement'
62 );
63
64 $image3 = $factory->image()->responsive('assets/ui-examples/images/Image/ski.jpg', 'Skiing');
65 $page5 = $factory->modal()->lightboxImagePage(
66 $image3,
67 'Ski Fun',
68 'Image source: https://stocksnap.io, Creative Commons CC0 license'
69 );
70
71 $modal = $factory->modal()->lightbox([$page, $page2, $page3, $page4, $page5]);
72 $button = $factory->button()->standard('Show some fancy images and texts', '')
73 ->withOnClick($modal->getShowSignal());
74
75 return $renderer->render([$button, $modal]);
76}