Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
image.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php
16 ?>
17 <?php
18  $_helper = $this->helper('Magento\Catalog\Helper\Output');
19  $_category = $block->getCurrentCategory();
20  $_imgHtml = '';
21  if ($_imgUrl = $_category->getImageUrl()) {
22  $_imgHtml = '<div class="category-image"><img src="' . $_imgUrl . '" alt="' . $block->escapeHtml($_category->getName()) . '" title="' . $block->escapeHtml($_category->getName()) . '" class="image" /></div>';
23  $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
24  /* @escapeNotVerified */ echo $_imgHtml;
25  }
26 ?>
$block
Definition: block.php:8
$_helper
Definition: image.phtml:18
$_category
Definition: image.phtml:19
$_imgHtml
Definition: image.phtml:20