Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Currencysymbol.php
Go to the documentation of this file.
1 <?php
13 
18 class Currencysymbol extends \Magento\Backend\Block\Widget\Form
19 {
24 
30  public function __construct(
31  \Magento\Backend\Block\Template\Context $context,
32  \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory,
33  array $data = []
34  ) {
35  $this->_symbolSystemFactory = $symbolSystemFactory;
36  parent::__construct($context, $data);
37  }
38 
44  protected function _construct()
45  {
46  $this->_controller = 'adminhtml_system_currencysymbol';
47  parent::_construct();
48  }
49 
55  protected $_symbolsData = [];
56 
62  protected function _prepareLayout()
63  {
64  $this->getToolbar()->addChild(
65  'save_button',
66  \Magento\Backend\Block\Widget\Button::class,
67  [
68  'label' => __('Save Currency Symbols'),
69  'class' => 'save primary save-currency-symbols',
70  'data_attribute' => [
71  'mage-init' => ['button' => ['event' => 'save', 'target' => '#currency-symbols-form']],
72  ]
73  ]
74  );
75 
76  return parent::_prepareLayout();
77  }
78 
85  public function getHeader()
86  {
87  return __('Currency Symbols');
88  }
89 
96  public function getFormActionUrl()
97  {
98  return $this->getUrl('adminhtml/*/save');
99  }
100 
107  public function getWebsiteId()
108  {
109  return $this->getRequest()->getParam('website');
110  }
111 
118  public function getStoreId()
119  {
120  return $this->getRequest()->getParam('store');
121  }
122 
128  public function getCurrencySymbolsData()
129  {
130  if (!$this->_symbolsData) {
131  $this->_symbolsData = $this->_symbolSystemFactory->create()->getCurrencySymbolsData();
132  }
133  return $this->_symbolsData;
134  }
135 
142  public function getInheritText()
143  {
144  return __('Use Standard');
145  }
146 }
__()
Definition: __.php:13
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory, array $data=[])