Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Form.php
Go to the documentation of this file.
1 <?php
8 
10 {
14  protected $resultPageFactory;
15 
20  public function __construct(
21  \Magento\Framework\App\Action\Context $context,
22  \Magento\Framework\View\Result\PageFactory $resultPageFactory
23  ) {
24  parent::__construct($context);
25  $this->resultPageFactory = $resultPageFactory;
26  }
27 
33  public function execute()
34  {
35  if ($this->_objectManager->get(\Magento\Customer\Model\Session::class)->isLoggedIn()) {
36  return $this->resultRedirectFactory->create()->setPath('customer/account/');
37  }
38  $resultPage = $this->resultPageFactory->create();
39  $resultPage->getConfig()->getTitle()->set(__('Orders and Returns'));
40  $this->_objectManager->get(\Magento\Sales\Helper\Guest::class)->getBreadcrumbs($resultPage);
41  return $resultPage;
42  }
43 }
__()
Definition: __.php:13
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
Definition: Form.php:20