# SVG file as favicon

I want to insert an svg file as favicon in Joomla. I have found the function addFavicon in Joomla core files (/libraries/joomla/document/html/html.php) which inserts the favicon link but I don't know how to use it and where in my template.

$path = JUri::root() . 'templates/MY_TEMPLATE/file.svg';$type = 'image/svg+xml';
$rel = 'icon';$doc = JFactory::getDocument();
$doc->addFavicon($path, $type,$rel);