NewAction.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Cms\Controller\Adminhtml\Page;
  8. use Magento\Framework\App\Action\HttpGetActionInterface;
  9. /**
  10. * Create CMS page action.
  11. */
  12. class NewAction extends \Magento\Backend\App\Action implements HttpGetActionInterface
  13. {
  14. /**
  15. * Authorization level of a basic admin session
  16. *
  17. * @see _isAllowed()
  18. */
  19. const ADMIN_RESOURCE = 'Magento_Cms::save';
  20. /**
  21. * @var \Magento\Backend\Model\View\Result\Forward
  22. */
  23. protected $resultForwardFactory;
  24. /**
  25. * @param \Magento\Backend\App\Action\Context $context
  26. * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory
  27. */
  28. public function __construct(
  29. \Magento\Backend\App\Action\Context $context,
  30. \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory
  31. ) {
  32. $this->resultForwardFactory = $resultForwardFactory;
  33. parent::__construct($context);
  34. }
  35. /**
  36. * Forward to edit
  37. *
  38. * @return \Magento\Backend\Model\View\Result\Forward
  39. */
  40. public function execute()
  41. {
  42. /** @var \Magento\Backend\Model\View\Result\Forward $resultForward */
  43. $resultForward = $this->resultForwardFactory->create();
  44. return $resultForward->forward('edit');
  45. }
  46. }