Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Delete.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  $widgetInstance = $this->_initWidgetInstance();
19  if ($widgetInstance) {
20  try {
21  $widgetInstance->delete();
22  $this->messageManager->addSuccess(__('The widget instance has been deleted.'));
23  } catch (\Exception $e) {
24  $this->messageManager->addError($e->getMessage());
25  }
26  }
27  $this->_redirect('adminhtml/*/');
28  return;
29  }
30 }
__()
Definition: __.php:13