Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Images.php
Go to the documentation of this file.
1 <?php
7 
13 abstract class Images extends \Magento\Backend\App\Action
14 {
20  const ADMIN_RESOURCE = 'Magento_Cms::media_gallery';
21 
27  protected $_coreRegistry = null;
28 
33  public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
34  {
35  $this->_coreRegistry = $coreRegistry;
36  parent::__construct($context);
37  }
38 
44  protected function _initAction()
45  {
46  $this->getStorage();
47  return $this;
48  }
49 
55  public function getStorage()
56  {
57  if (!$this->_coreRegistry->registry('storage')) {
58  $storage = $this->_objectManager->create(\Magento\Cms\Model\Wysiwyg\Images\Storage::class);
59  $this->_coreRegistry->register('storage', $storage);
60  }
61  return $this->_coreRegistry->registry('storage');
62  }
63 }
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
Definition: Images.php:33