Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
State.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
20  protected $resultRawFactory;
21 
29  public function __construct(
30  \Magento\Backend\App\Action\Context $context,
31  \Magento\Config\Model\Config\Structure $configStructure,
32  \Magento\Config\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker,
33  \Magento\Config\Model\Config $backendConfig,
34  \Magento\Framework\Controller\Result\RawFactory $resultRawFactory
35  ) {
36  parent::__construct($context, $configStructure, $sectionChecker, $backendConfig);
37  $this->resultRawFactory = $resultRawFactory;
38  }
39 
45  public function execute()
46  {
47  if ($this->getRequest()->getParam('isAjax')
48  && $this->getRequest()->getParam('container') != ''
49  && $this->getRequest()->getParam('value') != ''
50  ) {
51  $configState = [$this->getRequest()->getParam('container') => $this->getRequest()->getParam('value')];
52  $this->_saveState($configState);
54  $resultRaw = $this->resultRawFactory->create();
55  return $resultRaw->setContents('success');
56  }
57  }
58 }
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Config\Model\Config\Structure $configStructure, \Magento\Config\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker, \Magento\Config\Model\Config $backendConfig, \Magento\Framework\Controller\Result\RawFactory $resultRawFactory)
Definition: State.php:29