ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
custom_icon.php
Go to the documentation of this file.
1 <?php
2 function custom_icon()
3 {
4  global $DIC;
5  $f = $DIC->ui()->factory();
6  $renderer = $DIC->ui()->renderer();
7 
8  $buffer = array();
9 
10  $path = './src/UI/examples/Icon/Custom/my_custom_icon.svg';
11  $ico = $f->icon()->custom($path, 'Example');
12 
13  $buffer[] = $renderer->render($ico)
14  . ' Small Custom Icon';
15 
16  $buffer[] = $renderer->render($ico->withSize('medium'))
17  . ' Medium Custom Icon';
18 
19  $buffer[] = $renderer->render($ico->withSize('large'))
20  . ' Large Custom Icon';
21 
22 
23  $path = './templates/default/images/icon_fold.svg';
24  $ico = $f->icon()->custom($path, 'Example')
25  ->withAbbreviation('FD');
26 
27  $buffer[] = $renderer->render($ico)
28  . ' Small Custom Icon with Abbreviation';
29 
30  $buffer[] = $renderer->render($ico->withSize('medium'))
31  . ' Medium Custom Icon with Abbreviation';
32 
33  $buffer[] = $renderer->render($ico->withSize('large'))
34  . ' Large Custom Icon with Abbreviation';
35 
36 
37  return implode('<br><br>', $buffer);
38 }
$path
Definition: aliased.php:25
global $DIC
Definition: saml.php:7
custom_icon()
Definition: custom_icon.php:2