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
13 
15 {
19  protected $_template = 'Magento_Newsletter::template/list.phtml';
20 
24  protected function _prepareLayout()
25  {
26  $this->getToolbar()->addChild(
27  'add_button',
28  \Magento\Backend\Block\Widget\Button::class,
29  [
30  'label' => __('Add New Template'),
31  'onclick' => "window.location='" . $this->getCreateUrl() . "'",
32  'class' => 'add primary add-template'
33  ]
34  );
35 
36  $this->setChild(
37  'grid',
38  $this->getLayout()->createBlock(
39  \Magento\Newsletter\Block\Adminhtml\Template\Grid::class,
40  'newsletter.template.grid'
41  )
42  );
43  return parent::_prepareLayout();
44  }
45 
51  public function getCreateUrl()
52  {
53  return $this->getUrl('*/*/new');
54  }
55 
61  public function getHeaderText()
62  {
63  return __('Newsletter Templates');
64  }
65 }
__()
Definition: __.php:13