Go to the source code of this file.
◆ custom_icon()
Definition at line 2 of file custom_icon.php.
References $DIC, $f, and $path.
5 $f = $DIC->ui()->factory();
6 $renderer = $DIC->ui()->renderer();
10 $path =
'./src/UI/examples/Icon/Custom/my_custom_icon.svg';
11 $ico =
$f->icon()->custom(
$path,
'Example');
13 $buffer[] = $renderer->render($ico)
14 .
' Small Custom Icon';
16 $buffer[] = $renderer->render($ico->withSize(
'medium'))
17 .
' Medium Custom Icon';
19 $buffer[] = $renderer->render($ico->withSize(
'large'))
20 .
' Large Custom Icon';
23 $path =
'./templates/default/images/icon_fold.svg';
24 $ico =
$f->icon()->custom(
$path,
'Example')
25 ->withAbbreviation(
'FD');
27 $buffer[] = $renderer->render($ico)
28 .
' Small Custom Icon with Abbreviation';
30 $buffer[] = $renderer->render($ico->withSize(
'medium'))
31 .
' Medium Custom Icon with Abbreviation';
33 $buffer[] = $renderer->render($ico->withSize(
'large'))
34 .
' Large Custom Icon with Abbreviation';
37 return implode(
'<br><br>', $buffer);