ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_object_icon.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
17 function with_object_icon()
18 {
19  //Init Factory and Renderer
20  global $DIC;
21  $f = $DIC->ui()->factory();
22  $renderer = $DIC->ui()->renderer();
23 
24  $icon = $f->symbol()->icon()->standard("crs", 'Course');
25 
26  $image = $f->image()->responsive(
27  "./assets/images/logo/HeaderIcon.svg",
28  "Thumbnail Example"
29  );
30 
31  $content = $f->listing()->descriptive(
32  array(
33  "Entry 1" => "Some text",
34  "Entry 2" => "Some more text",
35  )
36  );
37 
38  $card = $f->card()->repositoryObject(
39  "Title",
40  $image
41  )->withObjectIcon(
42  $icon
43  )->withSections(
44  array(
45  $content,
46  $content
47  )
48  );
49  //Render
50  return $renderer->render($card);
51 }
$renderer
with_object_icon()
description: > Example for rendering a repository card with an object icon
global $DIC
Definition: shib_login.php:25