_coreRegistry = $coreRegistry; parent::__construct($context); $this->resultForwardFactory = $resultForwardFactory; $this->resultJsonFactory = $resultJsonFactory; $this->resultPageFactory = $resultPageFactory; $this->layoutFactory = $layoutFactory; } /** * Initialize Layout and set breadcrumbs * * @return \Magento\Backend\Model\View\Result\Page */ protected function createPage() { /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); $resultPage->setActiveMenu('Magento_Variable::system_variable') ->addBreadcrumb(__('Custom Variables'), __('Custom Variables')); return $resultPage; } /** * Initialize Variable object * * @return \Magento\Variable\Model\Variable */ protected function _initVariable() { $variableId = $this->getRequest()->getParam('variable_id', null); $storeId = (int)$this->getRequest()->getParam('store', 0); /* @var $variable \Magento\Variable\Model\Variable */ $variable = $this->_objectManager->create(\Magento\Variable\Model\Variable::class); if ($variableId) { $variable->setStoreId($storeId)->load($variableId); } $this->_coreRegistry->register('current_variable', $variable); return $variable; } }