Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Save.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
10 
11 class Save extends \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol implements HttpPostActionInterface
12 {
18  public function execute()
19  {
20  $symbolsDataArray = $this->getRequest()->getParam('custom_currency_symbol', null);
21  if (is_array($symbolsDataArray)) {
22  foreach ($symbolsDataArray as &$symbolsData) {
24  $filterManager = $this->_objectManager->get(\Magento\Framework\Filter\FilterManager::class);
25  $symbolsData = $filterManager->stripTags($symbolsData);
26  }
27  }
28 
29  try {
30  $this->_objectManager->create(\Magento\CurrencySymbol\Model\System\Currencysymbol::class)
31  ->setCurrencySymbolsData($symbolsDataArray);
32  $this->messageManager->addSuccess(__('You applied the custom currency symbols.'));
33  } catch (\Exception $e) {
34  $this->messageManager->addError($e->getMessage());
35  }
36 
37  $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
38  }
39 }
__()
Definition: __.php:13