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 
11 class Edit extends \Magento\Email\Controller\Adminhtml\Email\Template implements HttpGetActionInterface
12 {
18  public function execute()
19  {
20  $this->_view->loadLayout();
21  $template = $this->_initTemplate('id');
22  $this->_setActiveMenu('Magento_Email::template');
23  $this->_addBreadcrumb(__('Transactional Emails'), __('Transactional Emails'), $this->getUrl('adminhtml/*'));
24 
25  if ($this->getRequest()->getParam('id')) {
26  $this->_addBreadcrumb(__('Edit Template'), __('Edit System Template'));
27  } else {
28  $this->_addBreadcrumb(__('New Template'), __('New System Template'));
29  }
30  $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Email Templates'));
31  $this->_view->getPage()->getConfig()->getTitle()->prepend(
32  $template->getId() ? $template->getTemplateCode() : __('New Template')
33  );
34 
35  $this->_addContent(
36  $this->_view->getLayout()->createBlock(
37  \Magento\Email\Block\Adminhtml\Template\Edit::class,
38  'template_edit',
39  [
40  'data' => [
41  'email_template' => $template
42  ]
43  ]
44  )->setEditMode(
45  (bool)$this->getRequest()->getParam('id')
46  )
47  );
48  $this->_view->renderLayout();
49  }
50 }
_initTemplate($idFieldName='template_id')
Definition: Template.php:46
__()
Definition: __.php:13
_addContent(\Magento\Framework\View\Element\AbstractBlock $block)
_addBreadcrumb($label, $title, $link=null)
$template
Definition: export.php:12