ux_icon via php #2421
Answered
by
smnandre
tacman
asked this question in
Questions & Answers
ux_icon via php
#2421
-
Is there a way to get the icon via a php function, similar to ux_icon(icon_name) in twig? I'm creating my menus in PHP, e.g. $this->add($menu, id: 'gallery', label: 'Slides', icon: 'tabler:images');
$this->add($menu, id: 'share', label: 'Share', icon: 'tabler:qrcode'); In my php code, I'd like to get the svg directly, rather than outputting it in twig as a ux_icon call. I tried injecting the UXIconRuntime service, but that didn't work. Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
smnandre
Dec 15, 2024
Replies: 1 comment 1 reply
-
Did you try with the IconRendererInterface ? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tacman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you try with the IconRendererInterface ?