Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Edit.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10 
12 {
18  protected $_coreRegistry = null;
19 
24  public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
25  {
26  $this->_coreRegistry = $coreRegistry;
27  parent::__construct($context);
28  }
29 
35  public function execute()
36  {
37  $this->_coreRegistry->register('current_queue', $this->_objectManager->get(
38  \Magento\Newsletter\Model\Queue::class
39  ));
40 
41  $id = $this->getRequest()->getParam('id');
42  $templateId = $this->getRequest()->getParam('template_id');
43 
44  if ($id) {
45  $queue = $this->_coreRegistry->registry('current_queue')->load($id);
46  } elseif ($templateId) {
47  $template = $this->_objectManager->create(\Magento\Newsletter\Model\Template::class)->load($templateId);
48  $queue = $this->_coreRegistry->registry('current_queue')->setTemplateId($template->getId());
49  }
50 
51  $this->_view->loadLayout();
52 
53  $this->_setActiveMenu('Magento_Newsletter::newsletter_queue');
54  $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Newsletter Queue'));
55  $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Edit Queue'));
56 
57  $this->_addBreadcrumb(__('Newsletter Queue'), __('Newsletter Queue'), $this->getUrl('*/*'));
58  $this->_addBreadcrumb(__('Edit Queue'), __('Edit Queue'));
59 
60  $this->_view->renderLayout();
61  }
62 }
$queue
Definition: queue.php:21
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$id
Definition: fieldset.phtml:14
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
Definition: Edit.php:24
__()
Definition: __.php:13
$templateId
Definition: queue.php:15
_addBreadcrumb($label, $title, $link=null)
$template
Definition: export.php:12