/
Index.php
38 lines (35 loc) · 1.24 KB
/
Index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Controller\Noroute;
class Index extends \Magento\Framework\App\Action\Action
{
/**
* Noroute application handler
*
* @return void
*/
public function execute()
{
$status = $this->getRequest()->getParam('__status__');
if (!$status instanceof \Magento\Framework\DataObject) {
$status = new \Magento\Framework\DataObject();
}
$this->_eventManager->dispatch('controller_action_noroute', ['action' => $this, 'status' => $status]);
if ($status->getLoaded() !== true || $status->getForwarded() === true) {
$this->_view->loadLayout(['default', 'noroute']);
$this->_view->renderLayout();
} else {
$status->setForwarded(true);
$request = $this->getRequest();
$request->initForward();
$request->setParams(['__status__' => $status]);
$request->setControllerName($status->getForwardController());
$request->setModuleName($status->getForwardModule());
$request->setActionName($status->getForwardAction())->setDispatched(false);
}
}
}