Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
View.php
Go to the documentation of this file.
1 <?php
8 
12 
17 {
22 
27  public function __construct(
28  \Magento\Framework\App\Action\Context $context,
29  \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory
30  ) {
31  $this->resultForwardFactory = $resultForwardFactory;
32  parent::__construct($context);
33  }
34 
40  public function execute()
41  {
42  $pageId = $this->getRequest()->getParam('page_id', $this->getRequest()->getParam('id', false));
43  $resultPage = $this->_objectManager->get(\Magento\Cms\Helper\Page::class)->prepareResultPage($this, $pageId);
44  if (!$resultPage) {
45  $resultForward = $this->resultForwardFactory->create();
46  return $resultForward->forward('noroute');
47  }
48  return $resultPage;
49  }
50 }
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory)
Definition: View.php:27