Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Index.php
Go to the documentation of this file.
1 <?php
8 
9 abstract class Index extends \Magento\Backend\App\Action
10 {
16  const ADMIN_RESOURCE = 'Magento_Sales::sales_invoice';
17 
21  protected $resultPageFactory;
22 
27  public function __construct(
28  \Magento\Backend\App\Action\Context $context,
29  \Magento\Framework\View\Result\PageFactory $resultPageFactory
30  ) {
31  parent::__construct($context);
32  $this->resultPageFactory = $resultPageFactory;
33  }
34 
40  protected function _initAction()
41  {
43  $resultPage = $this->resultPageFactory->create();
44  $resultPage->setActiveMenu('Magento_Sales::sales_invoice')
45  ->addBreadcrumb(__('Sales'), __('Sales'))
46  ->addBreadcrumb(__('Invoices'), __('Invoices'));
47  return $resultPage;
48  }
49 
55  public function execute()
56  {
57  $resultPage = $this->_initAction();
58  $resultPage->getConfig()->getTitle()->prepend(__('Invoices'));
59  return $resultPage;
60  }
61 }
__()
Definition: __.php:13
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
Definition: Index.php:27