Neos\Media\ViewHelpers\FileTypeIconViewHelper::render PHP Метод

render() публичный Метод

Renders an HTML tag for a filetype icon for a given Neos.Media's asset instance
public render ( Neos\Media\Domain\Model\AssetInterface $file, integer | null $width = null, integer | null $height = null ) : string
$file Neos\Media\Domain\Model\AssetInterface
$width integer | null
$height integer | null
Результат 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();
    }
FileTypeIconViewHelper