Store views, Globalmaps - Confirmed Loading
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MageSail\Magesail\Block\Adminhtml\Nginx;
|
||||
|
||||
use Magento\Backend\Block\Template;
|
||||
use Magento\Backend\Block\Template\Context;
|
||||
use MageSail\Magesail\Model\NginxGlobalMapManager;
|
||||
|
||||
class Map extends Template
|
||||
{
|
||||
public function __construct(
|
||||
Context $context,
|
||||
private readonly NginxGlobalMapManager $nginxMapManager,
|
||||
array $data = []
|
||||
) {
|
||||
parent::__construct($context, $data);
|
||||
}
|
||||
|
||||
public function getMapFilePath(): ?string
|
||||
{
|
||||
return $this->nginxMapManager->getMapFilePath();
|
||||
}
|
||||
|
||||
public function getMapContent(): string
|
||||
{
|
||||
try {
|
||||
return $this->nginxMapManager->readMapFile();
|
||||
} catch (\Exception) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
public function getMapUrl(): string
|
||||
{
|
||||
return $this->getUrl('*/*/map');
|
||||
}
|
||||
|
||||
public function getFormKey(): string
|
||||
{
|
||||
return $this->formKey->getFormKey();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user