22 protected $_template =
'Magento_Theme::html/header/logo.phtml';
36 \
Magento\MediaStorage\Helper\File\Storage\Database $fileStorageHelper,
39 $this->_fileStorageHelper = $fileStorageHelper;
40 parent::__construct($context,
$data);
50 $currentUrl = $this->
getUrl(
'', [
'_current' =>
true]);
51 $urlRewrite = $this->
getUrl(
'*/*/*', [
'_current' =>
true,
'_use_rewrite' =>
true]);
52 return $currentUrl == $urlRewrite;
62 if (empty($this->_data[
'logo_src'])) {
65 return $this->_data[
'logo_src'];
75 if (empty($this->_data[
'logo_alt'])) {
76 $this->_data[
'logo_alt'] = $this->_scopeConfig->getValue(
77 'design/header/logo_alt',
78 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
81 return $this->_data[
'logo_alt'];
91 if (empty($this->_data[
'logo_width'])) {
92 $this->_data[
'logo_width'] = $this->_scopeConfig->getValue(
93 'design/header/logo_width',
94 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
97 return (
int)$this->_data[
'logo_width'] ? : (int)$this->getLogoImgWidth();
107 if (empty($this->_data[
'logo_height'])) {
108 $this->_data[
'logo_height'] = $this->_scopeConfig->getValue(
109 'design/header/logo_height',
110 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
113 return (
int)$this->_data[
'logo_height'] ? : (int)$this->getLogoImgHeight();
123 $folderName = \Magento\Config\Model\Config\Backend\Image\Logo::UPLOAD_DIR;
124 $storeLogoPath = $this->_scopeConfig->getValue(
125 'design/header/logo_src',
126 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
128 $path = $folderName .
'/' . $storeLogoPath;
129 $logoUrl = $this->_urlBuilder
130 ->getBaseUrl([
'_type' => \
Magento\Framework\UrlInterface::URL_TYPE_MEDIA]) .
$path;
134 }
elseif ($this->getLogoFile()) {
150 if ($this->_fileStorageHelper->checkDbUsage() && !$this->
getMediaDirectory()->isFile($filename)) {
151 $this->_fileStorageHelper->saveFileToFilesystem($filename);
elseif(isset( $params[ 'redirect_parent']))
getUrl($route='', $params=[])
getViewFileUrl($fileId, array $params=[])