/**
* Renders an <img> HTML tag for a filetype icon for a given Neos.Media's asset instance
*
* @param AssetInterface $file
* @param integer|null $width
* @param integer|null $height
* @return string
*/
public function render(AssetInterface $file, $width = null, $height = null)
{
$icon = FileTypeIconService::getIcon($file, $width, $height);
$this->tag->addAttribute('src', $this->resourceManager->getPublicPackageResourceUriByPath($icon['src']));
$this->tag->addAttribute('alt', $icon['alt']);
if ($width !== null) {
$this->tag->addAttribute('width', $width);
}
if ($height !== null) {
$this->tag->addAttribute('height', $height);
}
return $this->tag->render();
}