layoutFactory = $layoutFactory; parent::__construct( $context, $coreRegistry, $fileFactory, $translateInline, $resultPageFactory, $resultJsonFactory, $resultLayoutFactory, $resultRawFactory, $orderManagement, $orderRepository, $logger ); } /** * Generate order history for ajax request * * @return \Magento\Framework\Controller\Result\Raw */ public function execute() { $this->_initOrder(); $layout = $this->layoutFactory->create(); $html = $layout->createBlock(\Magento\Sales\Block\Adminhtml\Order\View\Tab\History::class) ->toHtml(); $this->_translateInline->processResponseBody($html); /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */ $resultRaw = $this->resultRawFactory->create(); $resultRaw->setContents($html); return $resultRaw; } }