ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
custom_icon.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\examples\Symbol\Icon\Custom
;
22
33
function
custom_icon
()
34
{
35
global
$DIC
;
36
$f
=
$DIC
->ui()->factory();
37
$renderer
=
$DIC
->ui()->renderer();
38
39
$buffer = array();
40
41
$path
=
'./assets/ui-examples/images/Icon/my_custom_icon.svg'
;
42
$ico =
$f
->symbol()->icon()->custom(
$path
,
'Example'
);
43
44
$buffer[] =
$renderer
->render($ico)
45
.
' Small Custom Icon'
;
46
47
$buffer[] =
$renderer
->render($ico->withSize(
'medium'
))
48
.
' Medium Custom Icon'
;
49
50
$buffer[] =
$renderer
->render($ico->withSize(
'large'
))
51
.
' Large Custom Icon'
;
52
53
54
//Note that the svg needs to contain strictly valid xml to work with abbreviations.
55
//Some exports e.g. form illustrator seem to be not properly formatted by default.
56
$path
=
'./assets/images/standard/icon_fold.svg'
;
57
$ico =
$f
->symbol()->icon()->custom(
$path
,
'Example'
)
58
->withAbbreviation(
'FD'
);
59
60
$buffer[] =
$renderer
->render($ico)
61
.
' Small Custom Icon with Abbreviation'
;
62
63
$buffer[] =
$renderer
->render($ico->withSize(
'medium'
))
64
.
' Medium Custom Icon with Abbreviation'
;
65
66
$buffer[] =
$renderer
->render($ico->withSize(
'large'
))
67
.
' Large Custom Icon with Abbreviation'
;
68
69
70
return
implode(
'<br><br>'
, $buffer);
71
}
$renderer
$renderer
Definition:
build_bootstrap.php:83
$path
$path
Definition:
ltiservices.php:30
ILIAS\UI\examples\Symbol\Icon\Custom
Definition:
custom_icon.php:21
ILIAS\UI\examples\Symbol\Icon\Custom\custom_icon
custom_icon()
Definition:
custom_icon.php:33
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$DIC
global $DIC
Definition:
shib_login.php:26
components
ILIAS
UI
src
examples
Symbol
Icon
Custom
custom_icon.php
Generated on Sat Oct 18 2025 23:04:41 for ILIAS by
1.9.4 (using
Doxyfile
)