ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
with_additional_high_resolution_source.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
43{
44 global $DIC;
45 $factory = $DIC->ui()->factory();
46 $renderer = $DIC->ui()->renderer();
47
48 $image = $factory
49 ->image()
50 ->responsive('assets/ui-examples/images/Image/mountains-144w.jpg', 'Mountains')
51 ->withAdditionalHighResSource('assets/ui-examples/images/Image/mountains-301w.jpg', 100)
52 ->withAdditionalHighResSource('assets/ui-examples/images/Image/mountains-602w.jpg', 300)
53 ->withAdditionalHighResSource('assets/ui-examples/images/Image/mountains.jpg', 500);
54
55 $card = $factory->card()->standard('Mountains', $image);
56
57 // render each card individually so every image has a different id.
58 return
59 '<div style="width: 100%; display: flex; justify-content: space-between">' .
60 '<div style="width: 49%;">' . $renderer->render($card) . '</div>' .
61 '<div style="width: 30%;">' . $renderer->render($card) . '</div>' .
62 '<div style="width: 19%;">' . $renderer->render($card) . '</div>' .
63 '</div>';
64}
$renderer
global $DIC
Definition: shib_login.php:26