Index.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice;
  8. abstract class Index extends \Magento\Backend\App\Action
  9. {
  10. /**
  11. * Authorization level of a basic admin session
  12. *
  13. * @see _isAllowed()
  14. */
  15. const ADMIN_RESOURCE = 'Magento_Sales::sales_invoice';
  16. /**
  17. * @var \Magento\Framework\View\Result\PageFactory
  18. */
  19. protected $resultPageFactory;
  20. /**
  21. * @param \Magento\Backend\App\Action\Context $context
  22. * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
  23. */
  24. public function __construct(
  25. \Magento\Backend\App\Action\Context $context,
  26. \Magento\Framework\View\Result\PageFactory $resultPageFactory
  27. ) {
  28. parent::__construct($context);
  29. $this->resultPageFactory = $resultPageFactory;
  30. }
  31. /**
  32. * Init layout, menu and breadcrumb
  33. *
  34. * @return \Magento\Backend\Model\View\Result\Page
  35. */
  36. protected function _initAction()
  37. {
  38. /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
  39. $resultPage = $this->resultPageFactory->create();
  40. $resultPage->setActiveMenu('Magento_Sales::sales_invoice')
  41. ->addBreadcrumb(__('Sales'), __('Sales'))
  42. ->addBreadcrumb(__('Invoices'), __('Invoices'));
  43. return $resultPage;
  44. }
  45. /**
  46. * Invoices grid
  47. *
  48. * @return \Magento\Backend\Model\View\Result\Page
  49. */
  50. public function execute()
  51. {
  52. $resultPage = $this->_initAction();
  53. $resultPage->getConfig()->getTitle()->prepend(__('Invoices'));
  54. return $resultPage;
  55. }
  56. }