mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
20 lines
659 B
PHP
20 lines
659 B
PHP
<?
|
|
|
|
use \Wt\Core\Media\Webp;
|
|
use \Wt\Core\Templater\Tools as TemplaterTools;
|
|
|
|
?>
|
|
<picture class="kit-picture <?=$arParams['CLASS']?>">
|
|
<?
|
|
$webp = new Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
|
if($webp->make()->isSuccess()) {
|
|
?><source srcset="<?=$webp->getPathOut(true)?>" type="image/webp"><?
|
|
}
|
|
?>
|
|
<img class="kit-img" src="<?=$arParams['SRC']?>" alt="<?=TemplaterTools::safeHtmlAttr($arParams['ALT'])?>"<?
|
|
if($arParams['TITLE']) {
|
|
?> title="<?=TemplaterTools::safeHtmlAttr($arParams['TITLE'])?>"<?
|
|
}
|
|
echo TemplaterTools::getAttrByArray($arParams['ATTR']);
|
|
?>/>
|
|
</picture>
|