ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
custom_icon.php File Reference

Go to the source code of this file.

Functions

 custom_icon ()
 

Function Documentation

◆ custom_icon()

custom_icon ( )

Definition at line 2 of file custom_icon.php.

References $DIC, $path, and array.

3 {
4  global $DIC;
5  $f = $DIC->ui()->factory();
6  $renderer = $DIC->ui()->renderer();
7 
8  $buffer = array();
9 
10  $path = './templates/default/images/icon_reps.svg';
11  $ico = $f->icon()->custom($path, 'Example');
12 
13  $buffer[] = $renderer->render($ico)
14  . ' Small Example';
15 
16  $buffer[] = $renderer->render($ico->withSize('medium'))
17  . ' Medium Example';
18 
19  $buffer[] = $renderer->render($ico->withSize('large'))
20  . ' Large Example';
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  . ' Custom Icon with Abbreviation';
29 
30  $buffer[] = $renderer->render($ico->withSize('medium'))
31  . ' Custom Icon with Abbreviation';
32 
33  $buffer[] = $renderer->render($ico->withSize('large'))
34  . ' Custom Icon with Abbreviation';
35 
36 
37  return implode('<br><br>', $buffer);
38 }
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.