Index.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cms\Controller\Adminhtml\Block;
  7. use Magento\Framework\App\Action\HttpGetActionInterface;
  8. /**
  9. * Index action.
  10. */
  11. class Index extends \Magento\Cms\Controller\Adminhtml\Block implements HttpGetActionInterface
  12. {
  13. /**
  14. * @var \Magento\Framework\View\Result\PageFactory
  15. */
  16. protected $resultPageFactory;
  17. /**
  18. * @param \Magento\Backend\App\Action\Context $context
  19. * @param \Magento\Framework\Registry $coreRegistry
  20. * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
  21. */
  22. public function __construct(
  23. \Magento\Backend\App\Action\Context $context,
  24. \Magento\Framework\Registry $coreRegistry,
  25. \Magento\Framework\View\Result\PageFactory $resultPageFactory
  26. ) {
  27. $this->resultPageFactory = $resultPageFactory;
  28. parent::__construct($context, $coreRegistry);
  29. }
  30. /**
  31. * Index action
  32. *
  33. * @return \Magento\Framework\Controller\ResultInterface
  34. */
  35. public function execute()
  36. {
  37. /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
  38. $resultPage = $this->resultPageFactory->create();
  39. $this->initPage($resultPage)->getConfig()->getTitle()->prepend(__('Blocks'));
  40. $dataPersistor = $this->_objectManager->get(\Magento\Framework\App\Request\DataPersistorInterface::class);
  41. $dataPersistor->clear('cms_block');
  42. return $resultPage;
  43. }
  44. }