Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
View.php
Go to the documentation of this file.
1 <?php
8 
11 
12 abstract class View extends Action\Action
13 {
17  protected $orderLoader;
18 
22  protected $resultPageFactory;
23 
29  public function __construct(
30  Action\Context $context,
33  ) {
34  $this->orderLoader = $orderLoader;
35  $this->resultPageFactory = $resultPageFactory;
36  parent::__construct($context);
37  }
38 
44  public function execute()
45  {
46  $result = $this->orderLoader->load($this->_request);
47  if ($result instanceof \Magento\Framework\Controller\ResultInterface) {
48  return $result;
49  }
50 
52  $resultPage = $this->resultPageFactory->create();
53 
55  $navigationBlock = $resultPage->getLayout()->getBlock('customer_account_navigation');
56  if ($navigationBlock) {
57  $navigationBlock->setActive('sales/order/history');
58  }
59  return $resultPage;
60  }
61 }
__construct(Action\Context $context, OrderLoaderInterface $orderLoader, PageFactory $resultPageFactory)
Definition: View.php:29