mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
15 lines
604 B
PHP
15 lines
604 B
PHP
<?
|
|
use Wt\Core\Type;
|
|
?>
|
|
<picture class="kit-picture <?=$arParams['CLASS']?>">
|
|
<?
|
|
$webp = new \Bx\Kit\Image\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
|
|
if($webp->convert()->isSuccess()) {
|
|
$webpSrc = $webp->getRelativePath();
|
|
?><source srcset="<?=$webpSrc?>" type="image/webp"><?
|
|
}
|
|
?>
|
|
<img class="kit-img" src="<?=$arParams['SRC']?>" alt="<?=Type\Str::safeHtmlAttr($arParams['ALT'])?>"<?if($arParams['TITLE']) {?> title="<?=Type\Str::safeHtmlAttr($arParams['TITLE'])?>"<?}?>
|
|
<?=\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR']);?>
|
|
/>
|
|
</picture>
|