Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CommentsHistory.php
Go to the documentation of this file.
1 <?php
8 
14 use Psr\Log\LoggerInterface;
16 
23 {
27  protected $layoutFactory;
28 
46  public function __construct(
47  Action\Context $context,
48  \Magento\Framework\Registry $coreRegistry,
49  \Magento\Framework\App\Response\Http\FileFactory $fileFactory,
50  \Magento\Framework\Translate\InlineInterface $translateInline,
51  \Magento\Framework\View\Result\PageFactory $resultPageFactory,
52  \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
54  \Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
57  LoggerInterface $logger,
59  ) {
60  $this->layoutFactory = $layoutFactory;
61  parent::__construct(
62  $context,
63  $coreRegistry,
64  $fileFactory,
65  $translateInline,
72  $logger
73  );
74  }
75 
81  public function execute()
82  {
83  $this->_initOrder();
84  $layout = $this->layoutFactory->create();
85  $html = $layout->createBlock(\Magento\Sales\Block\Adminhtml\Order\View\Tab\History::class)
86  ->toHtml();
87  $this->_translateInline->processResponseBody($html);
89  $resultRaw = $this->resultRawFactory->create();
90  $resultRaw->setContents($html);
91  return $resultRaw;
92  }
93 }
__construct(Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Framework\Translate\InlineInterface $translateInline, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory, \Magento\Framework\Controller\Result\RawFactory $resultRawFactory, OrderManagementInterface $orderManagement, OrderRepositoryInterface $orderRepository, LoggerInterface $logger, \Magento\Framework\View\LayoutFactory $layoutFactory)