Files
kit/templates/pictureOwlLazy.php
2021-08-14 14:35:10 +03:00

16 lines
681 B
PHP

<picture class="kit-picture">
<?
$webp = new \Bx\Kit\Image\Webp($_SERVER['DOCUMENT_ROOT'] . $arParams['SRC']);
if($webp->convert()->isSuccess()) {
$webpSrc = $webp->getRelativePath();
?><source class="owl-lazy" data-srcset="<?=$webpSrc?>" type="image/webp"><?
}
?>
<img class="kit-img owl-lazy" data-src="<?=$arParams['SRC']?>" alt="<?=\Bx\Kit\Lib\Type\Str::safeHtmlAttr($arParams['ALT'])?>"<?if($arParams['TITLE']) {?> title="<?=\Bx\Kit\Lib\Type\Str::safeHtmlAttr($arParams['TITLE'])?>"<?}?>
<?
if($arParams['ATTR']) {
echo \Bx\Kit\Template::get('attr', $arParams['ATTR']);
}
?>
/>
</picture>