ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
custom_icon.php
Go to the documentation of this file.
1<?php
2function 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/Symbol/Icon/Custom/my_custom_icon.svg';
11 $ico = $f->symbol()->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->symbol()->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}
An exception for terminatinating execution or to throw for unit testing.
custom_icon()
Definition: custom_icon.php:2
$DIC
Definition: xapitoken.php:46