[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Site 5 * @subpackage Layout 6 * 7 * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 /** 12 * Layout variables 13 * ----------------- 14 * @var array $displayData Array with all the given attributes for the image element. 15 * Eg: src, class, alt, width, height, loading, decoding, style, data-* 16 * Note: only the alt and src attributes are escaped by default! 17 */ 18 defined('_JEXEC') or die; 19 20 use Joomla\CMS\HTML\HTMLHelper; 21 use Joomla\Utilities\ArrayHelper; 22 23 $img = HTMLHelper::_('cleanImageURL', $displayData['src']); 24 25 $displayData['src'] = $this->escape($img->url); 26 27 if (isset($displayData['alt'])) { 28 if ($displayData['alt'] === false) { 29 unset($displayData['alt']); 30 } else { 31 $displayData['alt'] = $this->escape($displayData['alt']); 32 } 33 } 34 35 if ($img->attributes['width'] > 0 && $img->attributes['height'] > 0) { 36 $displayData['width'] = $img->attributes['width']; 37 $displayData['height'] = $img->attributes['height']; 38 39 if (empty($displayData['loading'])) { 40 $displayData['loading'] = 'lazy'; 41 } 42 } 43 44 echo '<img ' . ArrayHelper::toString($displayData) . '>';
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |