ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
with_additional_high_resolution_source.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
14 {
15  global $DIC;
16  $factory = $DIC->ui()->factory();
17  $renderer = $DIC->ui()->renderer();
18 
19  $image = $factory
20  ->image()
21  ->responsive('src/UI/examples/Image/mountains-144w.jpg', 'Mountains')
22  ->withAdditionalHighResSource('src/UI/examples/Image/mountains-301w.jpg', 100)
23  ->withAdditionalHighResSource('src/UI/examples/Image/mountains-602w.jpg', 300)
24  ->withAdditionalHighResSource('src/UI/examples/Image/mountains.jpg', 500);
25 
26  $card = $factory->card()->standard('Mountains', $image);
27 
28  // render each card individually so every image has a different id.
29  return
30  '<div style="width: 100%; display: flex; justify-content: space-between">' .
31  '<div style="width: 49%;">' . $renderer->render($card) . '</div>' .
32  '<div style="width: 30%;">' . $renderer->render($card) . '</div>' .
33  '<div style="width: 19%;">' . $renderer->render($card) . '</div>' .
34  '</div>';
35 }
with_additional_high_resolution_source()
Example showing different card sizes which use an image with additional high resolution sources...
global $DIC
Definition: feed.php:28