init
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\LegacyOrder\Controller\Adminhtml\Order;
|
||||
|
||||
use Esun\LegacyOrder\Block\Adminhtml\Order\View as ViewBlock;
|
||||
use Magento\Backend\App\Action;
|
||||
use Magento\Framework\App\Action\HttpGetActionInterface;
|
||||
use Magento\Framework\Controller\ResultFactory;
|
||||
use Magento\Framework\View\LayoutFactory;
|
||||
|
||||
class Modal extends Action implements HttpGetActionInterface
|
||||
{
|
||||
public const ADMIN_RESOURCE = 'Esun_LegacyOrder::orders';
|
||||
|
||||
public function __construct(
|
||||
Action\Context $context,
|
||||
private readonly LayoutFactory $layoutFactory
|
||||
) {
|
||||
parent::__construct($context);
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
$layout = $this->layoutFactory->create();
|
||||
$html = $layout->createBlock(ViewBlock::class)
|
||||
->setData('modal', true)
|
||||
->toHtml();
|
||||
|
||||
return $this->resultFactory->create(ResultFactory::TYPE_RAW)
|
||||
->setHeader('Content-Type', 'text/html; charset=UTF-8', true)
|
||||
->setContents($html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user