Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Template.php
Go to the documentation of this file.
1 <?php
7 
13 abstract class Template extends \Magento\Backend\App\Action
14 {
20  const ADMIN_RESOURCE = 'Magento_Email::template';
21 
28  protected $_coreRegistry = null;
29 
34  public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
35  {
36  $this->_coreRegistry = $coreRegistry;
37  parent::__construct($context);
38  }
39 
46  protected function _initTemplate($idFieldName = 'template_id')
47  {
48  $id = (int)$this->getRequest()->getParam($idFieldName);
49  $model = $this->_objectManager->create(\Magento\Email\Model\BackendTemplate::class);
50  if ($id) {
51  $model->load($id);
52  }
53  return $model;
54  }
55 }
_initTemplate($idFieldName='template_id')
Definition: Template.php:46
$id
Definition: fieldset.phtml:14
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry)
Definition: Template.php:34