mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+12
-8
@@ -1,15 +1,19 @@
|
||||
<?
|
||||
use Wt\Core\Type;
|
||||
|
||||
use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||
|
||||
?>
|
||||
<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"><?
|
||||
$webp = new \Wt\Core\Media\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="<?=Type\Str::safeHtmlAttr($arParams['ALT'])?>"<?if($arParams['TITLE']) {?> title="<?=Type\Str::safeHtmlAttr($arParams['TITLE'])?>"<?}?>
|
||||
<?=\Bx\Kit\Node\Lib::getAttrByArray($arParams['ATTR']);?>
|
||||
/>
|
||||
<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>
|
||||
Reference in New Issue
Block a user