Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeniedJson.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10 
11 class DeniedJson extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGetActionInterface
12 {
16  protected $resultJsonFactory;
17 
22  public function __construct(
23  \Magento\Backend\App\Action\Context $context,
24  \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
25  ) {
26  parent::__construct($context);
27  $this->resultJsonFactory = $resultJsonFactory;
28  }
29 
35  protected function _getDeniedJson()
36  {
37  return [
38  'ajaxExpired' => 1,
39  'ajaxRedirect' => $this->_helper->getHomePageUrl()
40  ];
41  }
42 
48  public function execute()
49  {
51  $resultJson = $this->resultJsonFactory->create();
52  return $resultJson->setData($this->_getDeniedJson());
53  }
54 }
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)
Definition: DeniedJson.php:22