Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Index.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
10 
11 class Index extends \Magento\Backend\App\Action implements HttpPostActionInterface
12 {
16  const ADMIN_RESOURCE = 'Magento_Widget::widget_instance';
17 
23  protected $_coreRegistry;
24 
28  protected $_widgetConfig;
29 
35  public function __construct(
36  \Magento\Backend\App\Action\Context $context,
37  \Magento\Widget\Model\Widget\Config $widgetConfig,
38  \Magento\Framework\Registry $coreRegistry
39  ) {
40  $this->_widgetConfig = $widgetConfig;
41  $this->_coreRegistry = $coreRegistry;
42  parent::__construct($context);
43  }
44 
50  public function execute()
51  {
52  // save extra params for widgets insertion form
53  $skipped = $this->getRequest()->getParam('skip_widgets');
54  $skipped = $this->_widgetConfig->decodeWidgetsFromQuery($skipped);
55 
56  $this->_coreRegistry->register('skip_widgets', $skipped);
57 
58  $this->_view->loadLayout('empty')->renderLayout();
59  }
60 }
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Widget\Model\Widget\Config $widgetConfig, \Magento\Framework\Registry $coreRegistry)
Definition: Index.php:35