Index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cms\Controller\Adminhtml\Page;
  7. use Magento\Framework\App\Action\HttpGetActionInterface;
  8. use Magento\Backend\App\Action\Context;
  9. use Magento\Framework\View\Result\PageFactory;
  10. /**
  11. * Index action.
  12. */
  13. class Index extends \Magento\Backend\App\Action implements HttpGetActionInterface
  14. {
  15. /**
  16. * Authorization level of a basic admin session
  17. *
  18. * @see _isAllowed()
  19. */
  20. const ADMIN_RESOURCE = 'Magento_Cms::page';
  21. /**
  22. * @var PageFactory
  23. */
  24. protected $resultPageFactory;
  25. /**
  26. * @param Context $context
  27. * @param PageFactory $resultPageFactory
  28. */
  29. public function __construct(
  30. Context $context,
  31. PageFactory $resultPageFactory
  32. ) {
  33. parent::__construct($context);
  34. $this->resultPageFactory = $resultPageFactory;
  35. }
  36. /**
  37. * Index action
  38. *
  39. * @return \Magento\Backend\Model\View\Result\Page
  40. */
  41. public function execute()
  42. {
  43. /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
  44. $resultPage = $this->resultPageFactory->create();
  45. $resultPage->setActiveMenu('Magento_Cms::cms_page');
  46. $resultPage->addBreadcrumb(__('CMS'), __('CMS'));
  47. $resultPage->addBreadcrumb(__('Manage Pages'), __('Manage Pages'));
  48. $resultPage->getConfig()->getTitle()->prepend(__('Pages'));
  49. $dataPersistor = $this->_objectManager->get(\Magento\Framework\App\Request\DataPersistorInterface::class);
  50. $dataPersistor->clear('cms_page');
  51. return $resultPage;
  52. }
  53. }