backend_icon - Twig Function

Info

This feature is available in Contao 5.5 and later.

With this function you can reference an icon of Contao’s back end theme and directly output HTML with an <img> tag in order to display that icon.

{# Generates an icon with the given alt attribute #}
{{ backend_icon('edit.svg', 'Edit the record') }}

Arguments

  • alt: The string for the alt attribute of the <img>.
  • attributes: An HtmlAttributes instance for additional HTML attributes on the <img>.